日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

使用rpm包安装mysql_centos下利用rpm包安装mysql

發布時間:2023/12/20 数据库 46 豆豆
生活随笔 收集整理的這篇文章主要介紹了 使用rpm包安装mysql_centos下利用rpm包安装mysql 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

安裝mysql步驟:

第一、?http://www.mysql.com/downloads/mysql-4.0.html下載MySQL-client-5.0.96-1.glibc23.x86_64.rpm和

MySQL-server-5.0.96-1.glibc23.x86_64.rpm

第二、安裝服務端:

[root@lfl01 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@lfl01 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 -emysql-libs-5.1.73-1.glibc.i386 --nodeps 強制卸載!

第三、啟動mysql服務

[root@lfl01 sean]# /etc/init.d/mysql start 或者

[root@lfl01 sean]# mysqld_safe &

通過netstat命令查看mysql是否啟動成功

[sean@lfl01 ~]$ 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@lfl01 sean]# ps -e

第四、停止mysql服務:

[root@lfl01 sean]# /usr/bin/mysqladmin -u root -p shutdown

重啟mysql服務:/etc/init.d/mysql restart

第五、重啟linux之后,啟動mysql服務

[root@lfl01 sean]# /usr/init.d/mysql start

[root@lfl01 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@lfl01 mysql]# /usr/bin/mysqladmin -u root password '*****'

登錄mysql

[root@lfl01 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@lfl01 sean]# rpm -qa|grep MySQL

MySQL-client-5.1.73-1.glibc23.i386

MySQL-server-5.1.73-1.glibc23.i386

執行此命令卸載 [root@lfl01 sean]# rpm -e --nodeps MySQL-client-5.1.73-1.glibc23.i386

[root@lfl01 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@lfl01 sean]# rm -rf /var/lib/mysql

后面的操作mysql和windows下一樣了。。。

總結

以上是生活随笔為你收集整理的使用rpm包安装mysql_centos下利用rpm包安装mysql的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。