ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Hi
i had placed % in my mysql configuration scripts but since its not listening localhost i checked out my vi /etc/my.cnf localhost is enabled root@localhost Desktop]# mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 42 Server version: 5.0.77 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> \q Bye [root@localhost Desktop]# mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) vi /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1 # Disabling symbolic-links is recommended to prevent assorted security risks; # to do so, uncomment this line: # symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid useradd chatRoot3 mysql1=$(</dev/urandom tr -dc A-Za-z0-9 | head -c6) ; echo $mysql1 ; echo $mysql1 | passwd --stdin chatRoot3 echo 'CREATE DATABASE chat3;' | mysql -uroot -psanjay echo "CREATE USER 'chatRoot3'@'%' IDENTIFIED BY '$mysql1';" | mysql -uroot -pecare2@ echo "GRANT ALL PRIVILEGES ON *.* TO 'chatRoot3'@'%' IDENTIFIED BY '$mysql1';" | mysql -uroot -psanjay echo -e "DATABASENAME\ndatabasename=chat3\ndatabaseusername=chatRoot3\npassword=$mysql1\ncustomername=$1 " | mail -s 'MysqlDatabase Access' xxxx@gmail.com regards arun |
are you sure you set the root password for mysql? I can see you can login without a pass
try this: Code:
select * from mysql.user where user='root'; java socket |
Quote:
Code:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root_password_goes_here'; |
All times are GMT -5. The time now is 12:01 AM. |