1. Installation Package
Rpm-IVH MySQL-server-5.1.30-0.glibc23.i386.rpm
Error: said the above package depends on the perl-DBI-1.32-5.i386.rpm package, first install
Rpm-IVH perl-DBI-1.32-5.i386.rpm
If other packages are required, install
Reinstall
Rpm-IVH MySQL-server-5.1.30-0.glibc23.i386.rpm (server)
Rpm-IVH MySQL-client-5.1.30-0.glibc23.i386.rpm (client tools)
Rpm-IVH MySQL-devel-5.1.30-0.glibc23.i386.rpm (Development Library, header files, etc)
Rpm-IVH MySQL-shared-community-5.1.30-0.rhel3.i386.rpm (some shared libraries such as so)
2. Test
PS-Aux | grep mysqld
3. Configuration
By default, only the local machine can be connected to the root
Login: mysql-uroot-p-hlocalhost
Use MySQL;
Select host, user from user;
+ -------------- + ------ +
| Host | user |
+ -------------- + ------ +
| 127.0.0.1 | root |
| Localhost |
| Localhost | root |
| Rhel4-server |
| Rhel4-server | root |
+ -------------- + ------ +
Therefore, only the local machine can be logged on by the root user.
Note that if the user column is empty, you can log on anonymously on the local machine, that is, you can log on by entering MySQL.
1) Change the root password
Use MySQL;
Update user SET Password = PASSWORD ("new password") where user = 'name ';
Flush privileges;
2) make the local machine unable to log on anonymously
Use MySQL;
Delete from user where user = '';
Flush privileges;
3) Other machines can log on as root.
Use MySQL;
Update user set host = '%' where user = 'root' and host = '2017. 0.0.1 ';
Flush privileges;
Or 1), 3) the following statement is also available
Grant all privileges on *. * to root @ '%' identified by 'Password' with grant option;
4. Start and Stop
/Etc/init. d/MySQL start/stop/restart
5. Related Directories
/Usr/bin MySQL related commands
/Usr/lib/MySQL mysql-related library file *.
/Usr/include/MySQL header file *. h
/Usr/share/MySQL configuration file
/Usr/sbin mysqld and other commands