OK, successfully used password, moving on. (when first run the mysql root password is blank so just hit enter for the first question) ~]# mysql_secure_installationĮnter current password for root (enter for none): Then run mysql secure installation here is sample output: Then set mysql to run at start up and start mysql ~]# chkconfig mysqld ~]# service mysqld start The command is: mysql_secure_installationįirst install mysql using yum ~]# yum install mysql-server I see the OP has already reinstalled mysql but I'd like to mention on CentOS you can use a great command which secures your installation for production and sets the mysql root password in the process. However, I am marking Chuck's answer below as accepted because he spent so much time looking into this. The solution to this problem was to delete MySQL using yum remove and then to follow the steps in this tutorial explicitly. Redirecting to /bin/systemctl start rviceįailed to issue method call: Unit rvice failed to load: No such file or directory. Loaded: not-found (Reason: No such file or directory)Īctive: inactive ~]# sudo service mysqld start Redirecting to /bin/systemctl status rvice The following two commands also had the following two results: ~]# sudo service mysqld status usr/bin/mysqladmin: connect to server at 'localhost' failedĮrror: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'Ĭheck that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists! How can I resolve this error so that I can set the root password in MySQL successfully? Updateīased on Chuck's suggestion, I tried the following, but got the following results: ~]# /usr/bin/mysqladmin -u root password 'newpwd' When I change step 3 to UPDATE er SET Password='NewPassHere' WHERE User='root', I get the following error: bash: UPDATE: command not found. I then typed in UPDATE er SET Password=PASSWORD('NewPassHere') WHERE User='root' īut step 3 produced the following error: -bash: syntax error near unexpected token `('.I then ran mysql - u root, which resulted in a lot of output and another prompt.I opened the terminal and typed in su - to run as root. To change MySQL root’s password to abc123 where that current password is set to newpass we need to use -p option which allows us to supply the mysqladmin command with a current user password. Step 1-: Add the below EPEL Repository sudo rpm -iUvh Step 2-: Install the MySql Server using below yum installer.Towards this end, I took the following steps: I installed MySQL on CentOS Linux and am trying to set the root password.
0 Comments
Leave a Reply. |