麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 數據庫 > MySQL > 正文

centOS安裝mysql5.7詳細教程

2024-07-24 13:15:07
字體:
來源:轉載
供稿:網友

本文為大家分享了centOS下安裝mysql5.7詳細步驟,供大家參考,具體內容如下

第一步:

第一句檢測系統是否自帶安裝mysql,若有執行第二句刪除系統自帶的mysql及其依賴。

yum list installed | grep mysqlyum -y remove mysql-libs.x86_64

第二步:

給CentOS添加rpm源,并且選擇較新的源,下面代碼逐句執行

wget dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpmyum localinstall mysql-community-release-el6-5.noarch.rpmyum repolist all | grep mysqlyum-config-manager --disable mysql55-communityyum-config-manager --disable mysql56-communityyum-config-manager --enable mysql57-community-dmryum repolist enabled | grep mysql

第三步:

安裝mysql 服務器

yum install mysql-community-server

第四步:

service mysqld start

第五步:

查看mysql是否自啟動,并且設置開啟自啟動

chkconfig --list | grep mysqldchkconfig mysqld on

第六步:

這一步很重要!!!

不知道從mysql哪個版本開始,mysql的root默認密碼就不為空了,在安裝的過程中默認密碼保存在安裝日志中了。我們要通過安裝日志找到默認密碼,用默認密碼登陸mysql成功后會強行讓你修改密碼,修改的密碼還要夠復雜(復合mysql默認的密碼策略)才能修改成功,一般帶大小寫字母特殊字符和數字超過8個字符就可以。

首先找到安裝日志

find / -name mysqld.log

然后發現該日志文件路徑在 /var/log/mysqld.log。然后用下面命令打開,按‘i'鍵上翻

vim /var/log/mysqld.log

centOS,mysql5.7

上圖紅色地方就是root密碼所在地

第七步:

mysql安全設置

mysql_secure_installation

輸入上面命令進行下面步驟

SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!In order to log into MySQL to secure it, we'll need the currentpassword for the root user. If you've just installed MySQL, andyou haven't set the root password yet, the password will be blank,so you should just press enter here.Enter current password for root (enter for none):<–初次運行,輸入剛剛找到的初始密碼,會強制你先修改密碼才能進行下去OK, successfully used password, moving on…Setting the root password ensures that nobody can log into the MySQLroot user without the proper authorisation.Set root password? [Y/n] <– 是否設置root用戶密碼,輸入y并回車或直接回車New password: <– 設置root用戶的密碼Re-enter new password: <– 再輸入一次你設置的密碼Password updated successfully!Reloading privilege tables..… Success!By default, a MySQL installation has an anonymous user, allowing anyoneto log into MySQL without having to have a user account created forthem. This is intended only for testing, and to make the installationgo a bit smoother. You should remove them before moving into aproduction environment.Remove anonymous users? [Y/n] <– 是否刪除匿名用戶,生產環境建議刪除,所以直接回車… Success!Normally, root should only be allowed to connect from 'localhost'. Thisensures that someone cannot guess at the root password from the network.Disallow root login remotely? [Y/n] <–是否禁止root遠程登錄,根據自己的需求選擇Y/n并回車,建議禁止… Success!By default, MySQL comes with a database named 'test' that anyone canaccess. This is also intended only for testing, and should be removedbefore moving into a production environment.Remove test database and access to it? [Y/n] <– 是否刪除test數據庫,直接回車- Dropping test database…… Success!- Removing privileges on test database…… Success!Reloading the privilege tables will ensure that all changes made so farwill take effect immediately.Reload privilege tables now? [Y/n] <– 是否重新加載權限表,直接回車… Success!Cleaning up…All done! If you've completed all of the above steps, your MySQLinstallation should now be secure.Thanks for using MySQL![root@server1 ~]#

第八步:

可選步驟,原來Linux下的MySQL默認是區分表名大小寫的,通過如下設置,可以讓MySQL不區分表名大小寫:
1、用root登錄,修改 /etc/my.cnf;
2、在[mysqld]節點下,加入一行: lower_case_table_names=1
3、重啟MySQL即可; service mysqld restart

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持VeVb武林網。


注:相關教程知識閱讀請移步到MYSQL教程頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 久久艹国产精品 | 久久tv免费国产高清 | h视频在线观看免费 | 国产日韩在线观看一区 | 在线免费观看毛片视频 | 色羞羞 | 国产精品亚洲三区 | 日本一级黄色毛片 | 成人免费自拍视频 | 亚洲国产精品一区二区精品 | 欧美一级片在线 | 最新se94se在线欧美 | 日本a大片| 久久国产精品免费视频 | 精品久久久久久中文字幕 | 欧美一级黄色免费看 | 一级黄色av电影 | 精品国产乱码久久久久久丨区2区 | 91av原创 | 91看片淫黄大片欧美看国产片 | 久久久久国产一区二区三区不卡 | 欧美一级二级毛片视频 | 中文字幕在线观看视频一区 | 亚洲一区二区中文字幕在线观看 | 少妇一级淫片免费放4p | 久久久久九九九女人毛片 | 三级国产三级在线 | 综合图区亚洲 | 国产精品一区免费在线观看 | 午夜看毛片 | 欧美一级毛片欧美一级成人毛片 | 欧美91看片特黄aaaa | 欧美成人se01短视频在线看 | 视频一区二区三区免费观看 | 久色成人网 | 特级毛片a级毛片100免费 | 国产刺激高潮av | 成人免费看视频 | 精品国产一区二区三区在线观看 | 中文字幕涩涩久久乱小说 | 91福利影视 |