Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
mysqladmin will not allow me to set my root
password. Therefore I cannot connect to a database
and nor create tables.This is what I am entering and here are the results.
# mysqladmin -u root password 000000
mysqladmin: connect to server at localhost failed.
error: 'Access denied for user: 'root@localhost' (Using
password: NO)This is what happens when I use the mysql
command.
# mysql -u root -p 000000
Enter password:ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)I have checked the mysqld and it is running.
Can anyone help me with an Error 1045 on MySQL on Linux 9.0Thanks
KBB

I don't know about MySQL, but for PostgresQL you have to be the user postgres instead of root for database admin. Once in you can assign rights for the user root.

assuming mysql is located in the local directory..
open a terminal session and enter the command belowcd /usr/local/mysql
then
bin/mysql_install_db
then create a user called mysql in users and groups
then type the following in the command line
chown -R mysql:mysql .
then start the mysql daemon by typing
bin/mysqld_safe &
now we must give root a password..
bin/mysqladmin -u root password 'new_password'
and to test... we type..
bin/mysqlshow -p
enter root password
and should return the mysql main db and a test db.
ok.. what we have done is installed the mysql db giving the user mysql global privelages, started the service, and gave root a password, and did a test to see if we got output from a command issued against the mysql db.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |