4 Replies - 475 Views - Last Post: 18 February 2018 - 05:26 PM

#1 Riggster   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 17-January 18

error connecting to new mysql installation

Posted 12 February 2018 - 01:01 AM

Can anyone help me figure out why I can't access the new mysql installation I just put on my computer? I installed mysql 5.7.21 on a windows 10 laptop today, set up a password for the root account, and then within the shell I have tried
\c -u root -p 
followed by the password, and it gives me the following error: "ERROR: Not Connected". The same thing happens when I type
mysql -u root -p 
. I can go into the mysql workbench, enter the root password, and test the connection successfully. Using the workbench i can also create a schema and tables within the schema. Can anyone suggest how to connect to my database in the shell?

Thanks for the help.

Is This A Good Question/Topic? 0
  • +

Replies To: error connecting to new mysql installation

#2 andrewsw   User is offline

  • Stealth IT
  • member icon

Reputation: 6736
  • View blog
  • Posts: 27,734
  • Joined: 12-December 12

Re: error connecting to new mysql installation

Posted 12 February 2018 - 02:51 AM

I don't know much about this but I would try specifying the host (although it probably defaults to localhost) and, particularly, the port number. a ref
Was This Post Helpful? 0
  • +
  • -

#3 no2pencil   User is online

  • Professor Snuggly Pants
  • member icon

Reputation: 6734
  • View blog
  • Posts: 31,197
  • Joined: 10-May 07

Re: error connecting to new mysql installation

Posted 12 February 2018 - 11:08 AM

Also, make sure to double-check that localhost (127.0.0.1) vs the laptop's local network address isn't being confused. You may want to provide --host (or -h?) to the mysql client on the cli.

If that still is not working, can you take a screenshot of the workbench configs? We might be able to differentiate the issue between the two.
Was This Post Helpful? 0
  • +
  • -

#4 Riggster   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 17-January 18

Re: error connecting to new mysql installation

Posted 18 February 2018 - 05:05 PM

here is a detailed mysql command where I try to specify the username, password, host, port, and schema.
-u root -h 127.0.0.1 -p 3306 -D stockquoteschema -p


Here is an image of my connection in the workbench:

Posted Image
Was This Post Helpful? 0
  • +
  • -

#5 no2pencil   User is online

  • Professor Snuggly Pants
  • member icon

Reputation: 6734
  • View blog
  • Posts: 31,197
  • Joined: 10-May 07

Re: error connecting to new mysql installation

Posted 18 February 2018 - 05:26 PM

Try the following instead :
mysql --user root --password --host 127.0.0.1 stockquoteschema

This will use username root, request password, host localhost, default database of stockquoteschema,& use default port of 3306. You have two uses of dash p (password), so the specified port 3306 was being passed as the password. There's no actual requirement to use the port, & the option of dash p is not to use the port.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1