1. Installation
Check whether MYSQL is installed in Linux.
Rpm-qa mysql
Mysql-4.1.7-4.RHEL4.1
Click add/remove mysql detail in programe.
Check mysql-server
2. Start
To check whether mysql has been started.
Service mysqld status
We can start Mysql in three ways:
Method 1: use the service command
Start Mysql
Service mysqld start
Stop mysql
Service mysqld stop
Method 2: Use the mysqld script to start Mysql:
/Etc/init. d/mysql start
Method 3: Use the safe_mysqld utility to start the Mysql service.
Safe_mysqld & // use & to put safe_mysqld in the background for execution.
3. Login
Change Password
Mysqladmin-u root password
Mysqladmin-u root password 'kaishi'
The "password" here is the new password. The system will prompt us to enter the old password (if mysql is just installed, the default password is blank)
You can log on to the local machine. However, an error is reported during client login on other machines.
ERROR 1130 (00000): Host 'xxx. xxx. xxx. XXX' is not allowed to connect to this MySQ
L server
First, check the settings of iptables and add and open port 3306.
Iptables-a input-p tcp-m tcp -- sport 3306-j ACCEPT
Iptables-a output-p tcp-m tcp -- dport 3306-j ACCEPT
Service iptables save
Service iptables restart
Or other machines cannot be accessed. It is estimated that the MYSQL permission is a problem.
Log on to the Local 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 |
+ ----------------------- + ------ + ------------------------------------------- +
We can see that the access permission is set only for localhost.