3

I'm running Ubuntu 14.04 and Nginx, and I recently installed mysql-server while following Digital Ocean's LEMP stack setup guide (I intend to run a WordPress site with it).
When I try to log into an interactive session using mysql -u root -p pass, something strange happens. Instead of being greeted with the standard login text (e.g. Welcome to the MySQL monitor. Commands end with ; or \g.), I get a prompt that looks like the following:

user@localhost ~ $ mysql -u root -p password
> CREATE DATABASE wordpress; // no login feedback, no creation feedback
> exit; // does not exit
> ^C // Ctrl+C panic button
user@localhost ~ $

There's no stdout or feedback at all, and I can't seem to get the login to work. I've tried using apt-get autoremove mysql-server and apt-get purge mysql-server, but was greeted with the same problem after reinstalling. I also get the same error when running as root.

3
  • try to remove the password from the command line, eg. "mysql -u root -p", it should ask you to type it afterwards
    – JohnKiller
    Oct 22, 2014 at 18:50
  • also, there should be no space between -p and password. if there is, you are telling wich database to open, and obiviously isn't "password"
    – JohnKiller
    Oct 22, 2014 at 18:52
  • Closing since this essentially a typo
    – random
    Feb 8, 2015 at 1:51

1 Answer 1

0

There should be no space between "-p" and the password, or you can just omit it so the client will ask you to enter it.

This is safer because it won't be stored in the shell command history.

Instead, if you are creating a shell script, just remove the space and add, as last parameter, the database name.

0

Not the answer you're looking for? Browse other questions tagged .