Home >Operation and Maintenance >Linux Operation and Maintenance >Basic steps to troubleshoot MySQL inaccessibility under Linux
This article explains the inability to access the MySQL problem on cloud server ECS Linux General troubleshooting steps.
Check whether the Linux operating system has installedMySQL
$ rpm -qa mysql mysql-4.1.7-4.RHEL4.1 # 说明已经安装了 MySQL
Check Status
Detect MySQL running status:
service mysqld status
## Start the service:
You can use three methods to start MySQL:
service mysqld start
/etc/init.d/mysql start
##Method 3: Use the safe_mysqld utility to start the MySQL service. This method can use relevant parameters:
safe_mysqld& //使用&表示将safe_mysqld放在后台执行。
##Login
Change password
mysqladmin -u root password mysqladmin -u root password 'kaishi'
If the local machine can log in, but the client of other machines Login error. For example:
ERROR 1130 (00000): Host 'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQ L server
iptables -A INPUT -p tcp -m tcp --sport 3306 -j ACCEPT iptables -A OUTPUT -p tcp -m tcp --dport 3306 -j ACCEPT service iptables saveIf it is still inaccessible, it may be a permission issue with MySQL. You can troubleshoot through the following steps: Log in on this machine
mysql -h localhost -u root -pkaishi show databases; use mysql; select Host, User, Password from user; +-----------------------+------+-------------------------------------------+ | Host | User | Password | +-----------------------+------+-------------------------------------------+ | localhost | root | *18F54215F48E644FC4E0F05EC2D39F88D7244B1A | | localhost.localdomain | root | | | localhost.localdomain | | | | localhost | | | +-----------------------+------+-------------------------------------------+
Format: grant permission on database name. table name user @Login hostident
if
grant select,update,insert,delete on easyview.* to sillycat@192.168.10.103 identified by "kaishi";
use mysql; select host,user,password from user;
update user set host = '%' where user = 'sillycat'; flush privileges;
The above is the detailed content of Basic steps to troubleshoot MySQL inaccessibility under Linux. For more information, please follow other related articles on the PHP Chinese website!