Install MySQL5.0.37 in Linux using the following three packages:
MySQL-client-community-5.0.37-0.rhel3.i386.rpm
MySQL-server-community-5.0.37-0.rhel3.i386.rpm
Perl-DBI-1.53-2.fc7.i386.rpm
(The following steps require root permissions)
1. Verify that MySQL has been installed
Rpm-qa | grep MySQL
If you have installed and need to uninstall it, run the following command:
Rpm-e MySQL-client-community MySQL-server-community
2. Installation
Run: rpm-ivh MySQL-client-community-5.0.37-0.rhel3.i386.rpm MySQL-server-community-5.0.37-0.rhel3.i386.rpm
If the console prompts:
Error: Failed dependencies:
Perl (DBI) is needed by MySQL-client-community-5.0.37-0.rhel3.i386
Perl (DBI) is needed by MySQL-server-community-5.0.37-0.rhel3.i386
Indicates that the DBI module is missing in the current operating system. Install the DBI module first.
Rpm-ivh perl-DBI-1.53-2.fc7.i386.rpm
The following text indicates that the installation is correct:
Preparing... ######################################## ### [100%]
1: perl-DBI ##################################### ###### [100%]
Run the MySQL installation command again.
The following text indicates that the installation is correct:
Preparing... ######################################## ### [100%]
1: mySQL-server-community ################################### ####### [1, 50%]
2: mySQL-client-community ################################### ####### [1, 100%]
3. initialize Installation
/Usr/bin/mysql_install_db
4. Start mysql
/Etc/init. d/mysql start
(There are two methods to stop: [mysqladmin-uroot-p shutdown] [/etc/init. d/mysql stop])
5. Verify that the installation is successful.
Netstat-nat | grep 3306
If you can see the following line, the installation is normal:
Tcp 0 0 0.0.0.0: 3306 0.0.0.0: * LISTEN
6. Modify the mysql root User Password
Mysqladmin-u root password '123'
7. log on to the mysql client
Mysql-uroot-p
Input: 123456
8. Create a database
Mysql> create database gbkdb character set gbk;
Query OK, 1 row affected (0.01 sec)
9. Create a user for the database gbkdb (user: user Password: 123)
Mysql> grant select, insert, update, delete, create on gbkdb. * to user @ "%" identified by "123 ";
Query OK, 0 rows affected (0.01 sec)