CentOS下使用rpm包安裝MySQL
CentOS下安裝MySQL步驟:
第一、 下載MySQL-client-5.0.96-1.glibc23.x86_64.rpm和
MySQL-server-5.0.96-1.glibc23.x86_64.rpm
第二、安裝服務端:
[root@linuxidc mysql]# rpm -ivh MySQL-server-5.1.73-1.glibc23.i386.rpm
顯示資訊:
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
。。。。。
Please report any problems with the /usr/bin/mysqlbug script!
如出現如上資訊,則表示伺服器端安裝成功。
安裝客戶端:[root@linuxidc mysql]# rpm -ivh MySQL-client-5.1.73-1.glibc23.i386.rpm
顯示如下資訊則表明安裝成功:
Preparing... ########################################### [100%]
1:MySQL-client ########################################### [100%]
若安裝過程中報該錯誤!!!
file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-5.1.73-1.glibc.i386 conflicts with file from package mysql-libs-5.1.73-1.glibc.i386
原因:已存在mysql-libs-5.1.73-1.glibc.i386的庫(這是linux自帶的)所以需要先刪除以前的庫才能安裝
rpm -e mysql-libs-5.1.73-1.glibc.i386 --nodeps 強制解除安裝!
第三、啟動mysql服務
[root@linuxidc sean]# /etc/init.d/mysql start 或者
[root@linuxidc sean]# mysqld_safe &
透過netstat命令檢視mysql是否啟動成功
[sean@linuxidc ~]$ netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN
tcp 0 52 192.168.1.128:22 192.168.1.106:51488 ESTABLISHED
tcp 1 0 192.168.1.128:38414 23.2.16.57:80 CLOSE_WAIT
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 ::1:631 :::* LISTEN
tcp 0 0 ::1:6010 :::* LISTEN
mysql預設埠號為3306,以上資訊中出現3306埠號,則啟動成功
檢視mysql程式:
[root@linuxidc sean]# ps -e
第四、停止mysql服務:
[root@linuxidc sean]# /usr/bin/mysqladmin -u root -p shutdown
重啟mysql服務:/etc/init.d/mysql restart
第五、重啟linux之後,啟動mysql服務
[root@linuxidc sean]# /usr/init.d/mysql start
[root@linuxidc mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.73 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
退出mysql:
mysql> exit
設定mysql密碼
[root@linuxidc mysql]# /usr/bin/mysqladmin -u root password '*****'
登入mysql
[root@linuxidc mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.73 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
出現以上資訊表明登入成功!!!
第六、解除安裝mysql
用rpm包解除安裝:
[root@linuxidc sean]# rpm -qa|grep MySQL
MySQL-client-5.1.73-1.glibc23.i386
MySQL-server-5.1.73-1.glibc23.i386
執行此命令解除安裝 [root@linuxidc sean]# rpm -e --nodeps MySQL-client-5.1.73-1.glibc23.i386
[root@linuxidc sean]# find / -name mysql
/var/lib/mysql
/var/lib/mysql/mysql
/var/lock/subsys/mysql
/usr/lib/mysql
/usr/share/mysql
/usr/mysql
/usr/bin/mysql
/etc/logrotate.d/mysql
/etc/rc.d/init.d/mysql
可以手動刪除mysql相關的檔案
[root@linuxidc sean]# rm -rf /var/lib/mysql
後面的操作mysql和windows下一樣了。。。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69978212/viewspace-2725348/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- CentOS 下 MySQL 5.6 基於 RPM 的下載、安裝、配置CentOSMySql
- centos(linux): rpm -V 驗證rpm包安裝程式的安全CentOSLinux
- 在Linux(Redhat/CentOS)下安裝MySQL之yum(rpm)線上安裝方式LinuxRedhatCentOSMySql
- 在Linux(Redhat/CentOS)下安裝MySQL之yum(rpm)離線安裝方式LinuxRedhatCentOSMySql
- CentOS8 安裝 MySQL8.0(RPM)CentOSMySql
- centos以RPM包方式安裝redis的方法CentOSRedis
- 透過yum在centos6.6上安裝mysql5.7.21rpm包CentOSMySql
- mysql8.0.30的RPM包安裝方法MySql
- CentOS 7.0下使用yum安裝MySQLCentOSMySql
- mysql安裝(rpm)MySql
- CentOS7離線安裝(rpm安裝)mysql資料庫CentOSMySql資料庫
- Centos 7 製作MySQL 5.7 RPM包CentOSMySql
- CentOS安裝MySQL的兩種方式——RPM和YUMCentOSMySql
- Mysql 5.7在OL 6上以RPM包安裝MySql
- 基於Linux的MySQL5.7RPM包安裝LinuxMySql
- yum如何解除安裝已安裝的rpm並安裝本地rpm包
- Centos7離線rpm安裝MySQL-5.7.29【推薦】CentOSMySql
- Yum命令之僅下載rpm安裝包且不安裝
- MySQL 5.7.22 rpm 安裝方式MySql
- rpm包安裝升級與解除安裝
- RPM包安裝與介紹
- 使用CheckInstall從原始碼製作RPM安裝包原始碼
- centos 下 安裝 node,nginx, mysqlCentOSNginxMySql
- CentOS7(64)環境使用rpm命令安裝gccCentOSGC
- Centos中徹底刪除Mysql(rpm、yum安裝的情況)CentOSMySql
- CentOS 8 停止維護後透過 rpm 包手動安裝 dockerCentOSDocker
- Mysql for Linux安裝配置之—— rpm(bundle)安裝MySqlLinux
- RPM包的安裝與升級
- CentOS 6.5下快速安裝MySQL 5.7.17CentOSMySql
- CentOS 7.0下使用yum安裝mysql的方法詳解CentOSMySql
- Greenplum_原始碼編譯安裝和RPM包安裝原始碼編譯
- Linux RPM包安裝、解除安裝、升級命令講解Linux
- CentOS6.7下使用cmake編譯安裝MySQL5.5.32CentOS編譯MySql
- CentOS 7 下使用yum安裝MySQL5.7方法CentOSMySql
- CentOS7下yum安裝MySQL 5.7CentOSMySql
- CentOS 6.7下yum方式安裝MySQL 5.6CentOSMySql
- CentOS7下安裝Mysql8.4CentOSMySql
- CentOS7下安裝mysql8CentOSMySql