centos7.2 安裝mysql5.6

公司需要安裝mysql5.6~~~~

安裝

安裝可用的5.6版本rpm包

rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

查看當前可用的mysql安裝資源

[root@bogon vagrant]# yum repolist enabled | grep "mysql.*-community.*"
mysql-connectors-community/x86_64 MySQL Connectors Community                  51
mysql-tools-community/x86_64      MySQL Tools Community                       63
mysql56-community/x86_64          MySQL 5.6 Community Server                 395

用yum安裝

yum -y install mysql-community-server


配置

加入開機啟動

systemctl enable mysqld

啟動

systemctl start mysqld
原本以為安裝成功之后能順利啟動(感覺ubuntu方便很多)游沿,結(jié)果啟動超時,查看日志發(fā)現(xiàn)缺少了一張表,后來找到了對應(yīng)的解決方案(感謝安靜的技術(shù)控)

引用:https://blog.csdn.net/a2011480169/article/details/51912771

問題:在linux上安裝mysql的時候出現(xiàn)Plugin ‘FEDERATED’ is disabled. 
/usr/sbin/mysqld: Table ‘mysql.plugin’ doesn’t exist問題辅搬。
[root@hadoop11 mysql]# more hadoop11.err
160714 14:51:30 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
160714 14:51:30 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
160714 14:51:30 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
160714 14:51:30 InnoDB: The InnoDB memory heap is disabled
160714 14:51:30 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160714 14:51:30 InnoDB: Compressed tables use zlib 1.2.3
160714 14:51:30 InnoDB: Using Linux native AIO
160714 14:51:30 InnoDB: Initializing buffer pool, size = 128.0M
160714 14:51:30 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!

原因: 
table ‘mysql.host’不存在的原因是因為新安裝的mysql服務(wù)后未玻,一般需要執(zhí)行數(shù)據(jù)庫初始化操作 尊惰,從而生成與權(quán)限相關(guān)的表憎乙,執(zhí)行命令如下:


/usr/bin/mysql_install_db --user=mysql

注:以上命令中的mysql_install_db與你安裝的mysql服務(wù)位置有關(guān)炭玫,如果不知道在哪卵凑,可以使用find / -name mysql_install_db找到其位置庆聘,然后執(zhí)行上面的命令。


[root@hadoop11 mysql]# find / -name mysql_install_db
/usr/bin/mysql_install_db

順利解決問題勺卢!

初始化

[root@bogon vagrant]# mysql_secure_installation



NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you 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): 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
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 MySQL
root user without the proper authorisation.

Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n
 ... skipping.

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!




All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!


Cleaning up...

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末伙判,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子黑忱,更是在濱河造成了極大的恐慌宴抚,老刑警劉巖,帶你破解...
    沈念sama閱讀 221,548評論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件甫煞,死亡現(xiàn)場離奇詭異菇曲,居然都是意外死亡,警方通過查閱死者的電腦和手機抚吠,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,497評論 3 399
  • 文/潘曉璐 我一進店門常潮,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人楷力,你說我怎么就攤上這事喊式。” “怎么了弥雹?”我有些...
    開封第一講書人閱讀 167,990評論 0 360
  • 文/不壞的土叔 我叫張陵垃帅,是天一觀的道長。 經(jīng)常有香客問我剪勿,道長贸诚,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 59,618評論 1 296
  • 正文 為了忘掉前任,我火速辦了婚禮酱固,結(jié)果婚禮上械念,老公的妹妹穿的比我還像新娘。我一直安慰自己运悲,他們只是感情好龄减,可當我...
    茶點故事閱讀 68,618評論 6 397
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著班眯,像睡著了一般希停。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上署隘,一...
    開封第一講書人閱讀 52,246評論 1 308
  • 那天宠能,我揣著相機與錄音,去河邊找鬼磁餐。 笑死违崇,一個胖子當著我的面吹牛,可吹牛的內(nèi)容都是我干的诊霹。 我是一名探鬼主播羞延,決...
    沈念sama閱讀 40,819評論 3 421
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼脾还!你這毒婦竟也來了伴箩?” 一聲冷哼從身側(cè)響起顷扩,我...
    開封第一講書人閱讀 39,725評論 0 276
  • 序言:老撾萬榮一對情侶失蹤曲楚,失蹤者是張志新(化名)和其女友劉穎麻捻,沒想到半個月后摄闸,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體挟阻,經(jīng)...
    沈念sama閱讀 46,268評論 1 320
  • 正文 獨居荒郊野嶺守林人離奇死亡详恼,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 38,356評論 3 340
  • 正文 我和宋清朗相戀三年房午,在試婚紗的時候發(fā)現(xiàn)自己被綠了墓赴。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片媚创。...
    茶點故事閱讀 40,488評論 1 352
  • 序言:一個原本活蹦亂跳的男人離奇死亡渗钉,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出钞钙,到底是詐尸還是另有隱情鳄橘,我是刑警寧澤,帶...
    沈念sama閱讀 36,181評論 5 350
  • 正文 年R本政府宣布芒炼,位于F島的核電站瘫怜,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏本刽。R本人自食惡果不足惜鲸湃,卻給世界環(huán)境...
    茶點故事閱讀 41,862評論 3 333
  • 文/蒙蒙 一赠涮、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧暗挑,春花似錦笋除、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,331評論 0 24
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至烹看,卻和暖如春国拇,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背惯殊。 一陣腳步聲響...
    開封第一講書人閱讀 33,445評論 1 272
  • 我被黑心中介騙來泰國打工贝奇, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人靠胜。 一個月前我還...
    沈念sama閱讀 48,897評論 3 376
  • 正文 我出身青樓,卻偏偏與公主長得像毕源,于是被迫代替她去往敵國和親浪漠。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 45,500評論 2 359

推薦閱讀更多精彩內(nèi)容