Download the following three files first:
mysql-server-5.5.28-1.linux2.6.x86_64.rpm
mysql-client-5.5.28-1.linux2.6.x86_64.rpm
mysql-devel-5.5.28-1.linux2.6.x86_64.rpm
Then log in using the root account to install:
1. Install server, devel, client:1. Install server, devel, client:
RPM-IVH--replacefiles mysql-s*.rpm
RPM-IVH--replacefiles mysql-d*.rpm
RPM-IVH--replacefiles mysql-c*.rpm
[Email protected] ~]# RPM-IVH--replacefiles mysql-server-5.5.28-1.linux2.6.x86_64.rpm
Preparing ... ########################################### [100%]
1:mysql-server ########################################### [100%]
[Email protected] ~]# RPM-IVH--replacefiles mysql-client-5.5.28-1.linux2.6.x86_64.rpm
Preparing ... ########################################### [100%]
1:mysql-client ########################################### [100%]
[Email protected] ~]# RPM-IVH--replacefiles mysql-devel-5.5.28-1.linux2.6.x86_64.rpm
Preparing ... ########################################### [100%]
1:mysql-devel ########################################### [100%]
To remove the installation can use Rpm-e Mysql-server, rpm-e mysql-devel, mysql-client can be;
2. Initialize the database:
/usr/bin/mysql_install_db
3. Start the MySQL service:
Service MySQL Start
Using Command Ps-ef | grep MySQL to view the MySQL process:
[[email protected] ~]# ps-ef|grep mysql root 3708 3057 0 18:39 pts/1 00:00:00 grep mysql
4. First login to set the root password:
First look at Cat/root/.mysql_secret//Sometimes you can't find it, don't look down.
[Email protected] ~]# Cat/root/.mysql_secret
# The random password set for the root user at Fri 15:57:18 (local time): fmycarvb This online says I didn't do it anyway.
Then the command line: Mysql-u root-p, then enter the above password:
[Email protected] ~]# mysql-uroot-p Enter password:welcome to the MySQL monitor. Commands End With; or \g. Your MySQL connection ID is 1 server version:5.5.28 mysql Community server (GPL)
Copyright (c), Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of the Oracle Corporation and/or its affiliates. Other names trademarks of their respective owners.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
To set the root password:
mysql> use MySQL
Database changed
mysql> Update user Set Password=password (' root ') where user= ' root ';
Query OK, 0 rows affected (0.15 sec)
Rows Matched:5 changed:0 warnings:0
mysql> flush Privileges;
Query OK, 0 rows Affected (0.00 sec)
Exit, re-login can use the new password login;
5. Set up remote login:
After logging in to MySQL with Root
Switch to MySQL database
mysql> show databases; +--------------------+ | Database | +--------------------+ | Information_schema | | MySQL | | Performance_schema | | Test | +--------------------+ 4 rows in Set (0.00 sec)
Mysql> Update user set host= '% ' where user= ' root '; ERROR 1046 (3d000): No database selected mysql> use MySQL Reading table information for completion of table and column Names can turn off this feature to get a quicker startup with-a
Database changed mysql> update user set host= '% ' where user= ' root '; ERROR 1062 (23000): Duplicate entry '%-root ' for key ' PRIMARY ' mysql> select Host,user from user; +-----------------------+------+ | host | user | +-----------------------+------+ | % | Root | | 127.0.0.1 | Root | | ::1 | Root | | localhost | | | Localhost.localdomain | | | Localhost.localdomain | Root | +-----------------------+------+ 6 rows in Set (0.00 sec)
And then:
Mysql> Grant all privileges on * * to ' root ' @ ' @ ' with GRANT option; ERROR 1105 (HY000): malformed hostname (illegal symbol: ' @ ') Mysql> grant all privileges on * * to ' root ' @ '% ' with gran T option; Query OK, 0 rows Affected (0.00 sec)
Mysql> exit
Bye
[[Email protected] ~]# service MySQL restart
Shutting down MySQL. success!
Starting MySQL. success!
You can log in remotely by restarting MySQL.
redhat6.4 installation mysql-server-5.5.28-1.linux2.6.x86_64.rpm