LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   MySQL: Login as Blank User From Command Line (https://www.linuxquestions.org/questions/linux-software-2/mysql-login-as-blank-user-from-command-line-323517/)

tortle 05-14-2005 04:35 PM

MySQL: Login as Blank User From Command Line
 
Hi:

Just used a MySQL 'GRANT' statement to give ''@'localhost' privs on a new db.
I wanted to run some tests from the mysql command line client before trying via PHP.
So I tried:
Code:

mysql -u
mysql -u ''
mysql -u '' -p
mysql --user='' -p
mysql --user= -p

but I keep getting "Access denied for user 'joe@localhost' ..." (where 'joe' is my username on the host box).

Anyone know the syntax for specifying "user==blank" from the command line? (Note: just leaving out the '-u' won't work; that also defaults to 'joe'.)

Thanks.

comprookie2000 05-14-2005 05:01 PM

Code:

# An important point to note is that this database is created by the root and so will not be accessible to any other user unless permitted by the root. Thus, in order to use this database from my account (called manish), I have to set the permissions by issuing the following command:

GRANT ALL ON employees.* TO manish@localhost IDENTIFIED BY "eagle"

The above command grants my account (manish@localhost) all the permissions on employees database and sets my password to eagle. You should replace manish with your user name and choose an appropriate password.

From this how to;
http://www.webdevelopersnotes.com/tu..._tutorial.php3


All times are GMT -5. The time now is 02:20 PM.