MySQL Error

c20121005

Verified User
Joined
Sep 11, 2016
Messages
9
da.jpg
I have tried to teach by the official, but unsuccessful


unnamed.png

ssh show
「-bash: syntax error near unexpected token `('」
 
Hello,

MySQL password for root and da_admin can be found in /usr/local/directadmin/scripts/setup.txt
Use the password to update/recover mysq.conf
 
thank you for you reply

i tried to change /usr/local/directadmin/scripts/setup.txt "mysql=" password to mysq.conf but the problem remains.

thanks
 
Alex have a look at the screenshot with the error. The command "use" is not found. :)

C20121005, just use mysql without use in front of it. So like this:
Code:
mysql
UPDATE mysql.user SET password=PASSWORD('rootpass') WHERE user='root';
FLUSH PRIVILEGES;
quit
then restart mysql.

See:
https://help.directadmin.com/item.php?id=45
if you fill in the credentials there, it will make the correct line for you. But don't use the "use" command, it won't work.
 
Last edited:
"Use" command was not found, becase the user failed to connect to MySQL console.

Using credentials from the file it's possible to connect to MySQL server via phpmyadmin with root's password if da_admin's password was changed and lost.
 
Correct, the help file is not very clear in how to get in though.
That should start up mysql without the need for a root password. Once in, type
It doesn't say how to get in so I understand the confusion that somebody can think "use mysql" is the way to get in. I missed that myself too. Easy to overlook. The help file could mention that or just add it to the lines to type.

In that case this should be the correct lines to set a new root password, correct?
Code:
mysql
use mysql
UPDATE mysql.user SET password=PASSWORD('rootpass') WHERE user='root';
FLUSH PRIVILEGES;
quit
 
@Richard,

I highly not suggest that the TS would work in a shell console as root. Looking into the user's screenshot I'm really worried about a possibility that the user ruins the server. So it's better use phpMyAdmin.

Please see the user executes
Code:
[B]item.php?id=45[/B]
as a command in a root console, then
Code:
[B]item.php?id=45[COLOR=#000000][FONT='inherit']/etc/init.d/mysqld stop[/FONT][/COLOR][/B]
in a hope to stop MySQL server.

As for changing password, check this:
http://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html

MySQL 5.7.6 and later:
Code:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
MySQL 5.7.5 and earlier:
Code:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');
 
I highly not suggest that the TS would work in a shell console as root.
It's just from the DA help section, following these commands exactly should cause no harm. But you are right, if he's not experienced enough he better use phpmyadmin.
 
Back
Top