mysql prompt is not an internal or external command (and 1130 problem)

Mysql enters mysql in cmd, the prompt is not an internal or external command

Reason: The path of mysql is not added in the environment variable PATH.

Solution:

1. Win+r–>services.msc–>Right-click mysql service–>Properties–>Find the executable path and copy it out.
2. Right-click "My Computer"–>Properties–>Advanced System Settings–>Environment Variables– >System Variables–>PATH–>New–>Locate the above "executable path"
to your MYSQL installation directory and then find the bin directory, such as: C:\Program Files\MySQL\MySQL Server 5.5\bin

After adding environment variables, start DOS as an administrator, and then test under DOS:

mysql -u root -p

View mysql version

select version();

Insert picture description here

Restart of mysql in Linux

(Restart) service mysqld restart

Remote connection to mysql (prompt message)

ERROR 1130: Host xxx.xxx.xxx.xxx is not allowed to connect to this MySQL server.
Some may say that it is enough to turn off the firewall. In fact, the fundamental problem is not the firewall. Simply turning off the firewall will not allow users to connect remotely. Permissions issue.

The possible problem is:
mysql on the server does not have access permissions

The solution is:

Insert picture description here
The command is as follows:

mysql -u root -p password

GRANT ALL PRIVILEGES ON . TO'root'@'%' IDENTIFIED BY'Your database password' WITH GRANT OPTION;

flush privileges;
(Refresh privileges without restarting)

Guess you like

Origin blog.csdn.net/qq_40145879/article/details/108656617