centosの下でmysqlの最新版は最終的にインストールに成功しました!いくつかの重要な場所をバックアップします

10171 ワード

私はもともと简単なLAMP环境を作るためだけに、自分で自分から手を出して、こんなに多くの问题が発生することを発见しました.(by default7#zbphp.com)
多くの場所でMysqlをインストールするヒントはyumキーでインストールします.shellコマンドは、次のようになります.
yum install mysql

yum install mysql-server

yum install mysql-devel

しかし、このコマンドがインストールするmysqlのバージョン番号は非常に古く、5.1.0 xのバージョン番号の、公式サイトのMysqlはすでに5.6です.xバージョン番号です.古すぎて、08年に5.1のバージョン番号が出たのを覚えています.
最新バージョン番号のインストールを堅持し、MYSQL公式サイトでrpm-.tarインストールパッケージ、300 MB程度.linux64.
[root@localhost mysqlinstall]# ls 
MySQL-client-5.6.19-1.linux_glibc2.5.x86_64.rpm
MySQL-devel-5.6.19-1.linux_glibc2.5.x86_64.rpm
MySQL-embedded-5.6.19-1.linux_glibc2.5.x86_64.rpm
MySQL-server-5.6.19-1.linux_glibc2.5.x86_64.rpm
MySQL-shared-5.6.19-1.linux_glibc2.5.x86_64.rpm
MySQL-shared-compat-5.6.19-1.linux_glibc2.5.x86_64.rpm
MySQL-test-5.6.19-1.linux_glibc2.5.x86_64.rpm
[root@localhost mysqlinstall]# pwd
/home/[email protected]/Downloads/mysqlinstall
[root@localhost mysqlinstall]# 

しかし、ネット上(CSDNブログ、blogcnブログ)のヒントに従ってインストールするのはいつもいろいろな問題で、いろいろな問題があって、実行できません.
最後に非常に多くの試行を行い、最終的に正常にインストールされました.
[root@localhost /]# yum remove mysql
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Remove Process
No Match for argument: mysql
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * extras: mirrors.163.com
 * updates: mirrors.163.com
Package(s) mysql available, but not installed.
No Packages marked for removal
[root@localhost /]# yum remove mysql-server
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package MySQL-server.x86_64 0:5.6.19-1.linux_glibc2.5 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package          Arch       Version                        Repository     Size
================================================================================
Removing:
 MySQL-server     x86_64     5.6.19-1.linux_glibc2.5        installed     248 M

Transaction Summary
================================================================================
Remove        1 Package(s)

Installed size: 248 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : MySQL-server-5.6.19-1.linux_glibc2.5.x86_64                  1/1 
  Verifying  : MySQL-server-5.6.19-1.linux_glibc2.5.x86_64                  1/1 

Removed:
  MySQL-server.x86_64 0:5.6.19-1.linux_glibc2.5                                 

Complete!
[root@localhost /]# yum remove MySQL-*
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package MySQL-devel.x86_64 0:5.6.19-1.linux_glibc2.5 will be erased
---> Package MySQL-shared.x86_64 0:5.6.19-1.linux_glibc2.5 will be erased
---> Package MySQL-shared-compat.x86_64 0:5.6.19-1.linux_glibc2.5 will be erased
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64
--> Running transaction check
---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package             Arch   Version                 Repository             Size
================================================================================
Removing:
 MySQL-devel         x86_64 5.6.19-1.linux_glibc2.5 installed              17 M
 MySQL-shared        x86_64 5.6.19-1.linux_glibc2.5 @/MySQL-shared-5.6.19-1.linux_glibc2.5.x86_64
                                                                          7.8 M
 MySQL-shared-compat x86_64 5.6.19-1.linux_glibc2.5 @/MySQL-shared-compat-5.6.19-1.linux_glibc2.5.x86_64
                                                                           11 M
Removing for dependencies:
 perl-DBD-MySQL      x86_64 4.013-3.el6             @base                 338 k

Transaction Summary
================================================================================
Remove        4 Package(s)

Installed size: 36 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : MySQL-devel-5.6.19-1.linux_glibc2.5.x86_64                   1/4 
  Erasing    : perl-DBD-MySQL-4.013-3.el6.x86_64                            2/4 
  Erasing    : MySQL-shared-compat-5.6.19-1.linux_glibc2.5.x86_64           3/4 
  Erasing    : MySQL-shared-5.6.19-1.linux_glibc2.5.x86_64                  4/4 
  Verifying  : MySQL-shared-compat-5.6.19-1.linux_glibc2.5.x86_64           1/4 
  Verifying  : MySQL-devel-5.6.19-1.linux_glibc2.5.x86_64                   2/4 
  Verifying  : MySQL-shared-5.6.19-1.linux_glibc2.5.x86_64                  3/4 
  Verifying  : perl-DBD-MySQL-4.013-3.el6.x86_64                            4/4 

Removed:
  MySQL-devel.x86_64 0:5.6.19-1.linux_glibc2.5                                  
  MySQL-shared.x86_64 0:5.6.19-1.linux_glibc2.5                                 
  MySQL-shared-compat.x86_64 0:5.6.19-1.linux_glibc2.5                          

Dependency Removed:
  perl-DBD-MySQL.x86_64 0:4.013-3.el6                                           

Complete!
[root@localhost /]# yum remove MySQL-*
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Remove Process
No Match for argument: MySQL-*
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * extras: mirrors.163.com
 * updates: mirrors.163.com
Package(s) MySQL-* available, but not installed.
No Packages marked for removal
[root@localhost /]# whereis mysql
mysql: /usr/lib64/mysql
[root@localhost /]# which mysql
/usr/bin/which: no mysql in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/default7/bin)
[root@localhost /]# yum remove MySQL-shared
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Remove Process
No Match for argument: MySQL-shared
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * extras: mirrors.163.com
 * updates: mirrors.163.com
No Packages marked for removal
[root@localhost /]# whereis mysql
mysql: /usr/lib64/mysql
[root@localhost /]# which mysql
/usr/bin/which: no mysql in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/default7/bin)
[root@localhost /]# yum remove MySQL-test
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Remove Process
No Match for argument: MySQL-test
Loading mirror speeds from cached hostfile
 * base: mirrors.btte.net
 * extras: mirrors.btte.net
 * updates: mirrors.btte.net
Package(s) MySQL-test available, but not installed.
No Packages marked for removal
[root@localhost /]# clear



実際、私はずっと何度もインストールしています.いつも問題があって、起動できないか、エラーを報告できません.原因は最初のインストール手順と間違っていて、それから何度も再インストールします.
しかし、完全にアンインストールされていません.rpm-e Mysqlこれは大文字と小文字を区別しているようですが、最初はディレクトリを直接削除してアンインストールしましたが、rpm-e-nodeps mysqlでアンインストールしましたが、まだ残っています.
最後にyum remove mysql,mysql-server,mysql-sharedでアンインストールし、きれいにアンインストールするために、その後、すべてのディレクトリにmysqlがあるものを削除します.そしてもう一度取り付けます.
[root@localhost mysqlinstall]# ls
MySQL-client-5.6.19-1.linux_glibc2.5.x86_64.rpm
MySQL-devel-5.6.19-1.linux_glibc2.5.x86_64.rpm
MySQL-embedded-5.6.19-1.linux_glibc2.5.x86_64.rpm
MySQL-server-5.6.19-1.linux_glibc2.5.x86_64.rpm
MySQL-shared-5.6.19-1.linux_glibc2.5.x86_64.rpm
MySQL-shared-compat-5.6.19-1.linux_glibc2.5.x86_64.rpm
MySQL-test-5.6.19-1.linux_glibc2.5.x86_64.rpm
[root@localhost mysqlinstall]# rpm -ivh MySQL-server-*.rpm
Preparing...                ########################################### [100%]
   1:MySQL-server           ########################################### [100%]
[root@localhost mysqlinstall]# rpm -ivh MySQL-client-*.rpm
Preparing...                ########################################### [100%]
   1:MySQL-client           ########################################### [100%]
[root@localhost mysqlinstall]# rpm -ivh MySQL-devel-*.rpm
Preparing...                ########################################### [100%]
   1:MySQL-devel            ########################################### [100%]
[root@localhost mysqlinstall]# service mysql status
 ERROR! MySQL is not running
[root@localhost mysqlinstall]# service mysql start
Starting MySQL.. SUCCESS! 

設定passwordを変更します.元のpasswordは/root/このディレクトリにあります.ls-aはmysqlのファイルを見ることができます.元のpasswordがあります.
mysql> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement


mysql> select user();
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
mysql> set password=password('zbphp.com');
Query OK, 0 rows affected (0.00 sec)

mysql> show user();
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'user()' at line 1
mysql> select user();
+----------------+
| user()         |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.01 sec)

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.6.19    |
+-----------+
1 row in set (0.00 sec)

mysql>