<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 325,  comments - 25,  trackbacks - 0

    Red Hat Enterprise Linux 6 / Oracle Linux 6 (Architecture Independent), RPM Package


    9.0K
    (mysql57-community-release-el6-9.noarch.rpm)

    2. 下載并安裝Mysql的yum倉庫

    下載Mysql的yum倉庫

    http://dev.mysql.com/downloads/repo/yum/

    然后安裝一下這個倉庫列表

    $ sudo yum localinstall mysql-community-release-el6-5.noarch.rpm  

    3. 搜索可安裝的mysql版本

    執行這個命令后就能看到可安裝的mysql:

    # yum repolist enabled | grep "mysql.*-community.*" 

    如果我們是要安裝最新的版本,那么可以直接執行

    # sudo yum install mysql-community-server 

    如果我們要選擇版本,可以先執行下面這個命令查看一下有哪些版本:

    # yum repolist all | grep mysql 

    如果要選擇版本的話,有兩種方式,一種是使用命令來

    $ sudo yum-config-manager --disable mysql56-community $ sudo yum-config-manager --enable mysql57-community-dmr 

    這個命令就是在倉庫中啟用5.7版本的,禁用5.6版本子倉庫
    或者編輯/etc/yum.repos.d/mysql-community.repo文件

    # Enable to use MySQL 5.6 [mysql56-community] name=MySQL 5.6 Community Server baseurl=//repo.mysql.com/yum/mysql-5.6-community/el/5/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql  

    enabled=0表示禁用
    比如要安裝5.7版本的mysql,要確定5.6的enabled=0,5.7的enabled=1,一次保證只啟用一個子倉庫

    # Note: MySQL 5.7 is currently in development. For use at your own risk. # Please read with sub pages: https://dev.mysql.com/doc/relnotes/mysql/5.7/en/ [mysql57-community-dmr] name=MySQL 5.7 Community Server Development Milestone Release baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql 

    然后我們又可以愉快的安裝mysql了

    $ sudo yum install mysql-community-server 

    安裝完成后我們啟動mysql

    $ sudo service mysqld start 

    查看mysql狀態

    $ sudo service mysqld status 

    啟動mysql服務并初始化:

    # /etc/init.d/mysqld start Initializing MySQL database:  PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands:  /usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root -h iZ94vana2fdZ password 'new-password'  Alternatively you can run: /usr/bin/mysql_secure_installation  which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers.  See the manual for more instructions.  Please report any problems at http://bugs.mysql.com/  [ OK ] Starting mysqld: [ OK ] 

    4. 相關命令

    啟動mysql服務

    # service mysqld start 

    重啟mysql服務

    # service mysqld restart 

    停止mysql服務

    # service mysqld stop 


    1. Stop the service/daemon of mysql running

      [root ~]# service mysql stop    mysql stop/waiting 
    2. Start mysql without any privileges using the following option; This option is used to boot up and do not use the privilege system of MySQL.

      [root ~]# mysqld_safe --skip-grant-tables & 

    At this moment, the terminal will seem to halt. Let that be, and use new terminal for next steps.

    1. enter the mysql command prompt

      [root ~]# mysql -u root mysql>  
    2. Fix the permission setting of the root user ;

      mysql> use mysql; Database changed mysql> select * from  user; Empty set (0.00 sec) mysql> truncate table user; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.01 sec) mysql> grant all privileges on *.* to root@localhost identified by 'YourNewPassword' with grant option; Query OK, 0 rows affected (0.01 sec) 

    *if you don`t want any password or rather an empty password

        mysql> grant all privileges on *.* to root@localhost identified by '' with grant option;     Query OK, 0 rows affected (0.01 sec)*     mysql> flush privileges;     Query OK, 0 rows affected (0.00 sec) 

    Confirm the results:

        mysql> select host, user from user; +-----------+------+ | host      | user | +-----------+------+ | localhost | root | +-----------+------+ 1 row in set (0.00 sec) 
    1. Exit the shell and restart mysql in normal mode.

      mysql> quit; [root ~]# kill -KILL [PID of mysqld_safe] [root ~]# kill -KILL [PID of mysqld] [root ~]# service mysql start 
    2. Now you can successfully login as root user with the password you set

       [root ~]# mysql -u root -pYourNewPassword   mysql> 


    posted on 2016-09-27 16:55 長春語林科技 閱讀(410) 評論(0)  編輯  收藏 所屬分類: mysql
    <2016年9月>
    28293031123
    45678910
    11121314151617
    18192021222324
    2526272829301
    2345678

     

    長春語林科技歡迎您!

    常用鏈接

    留言簿(6)

    隨筆分類

    隨筆檔案

    文章分類

    文章檔案

    相冊

    收藏夾

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 免费人成年激情视频在线观看| 国产人成免费视频网站| 日本不卡视频免费| 亚洲爆乳精品无码一区二区| 成人免费看吃奶视频网站| 一本色道久久88亚洲精品综合| 在线v片免费观看视频| 亚洲日本人成中文字幕| 天天看免费高清影视| 日日摸日日碰夜夜爽亚洲| 又粗又硬免费毛片| 久久国产精品免费一区| 亚洲国产精品无码久久久秋霞2| 97国免费在线视频| 亚洲精品私拍国产福利在线| 18禁美女裸体免费网站| 亚洲欧美成人一区二区三区| 亚洲 国产 图片| 国产一级黄片儿免费看| 久久丫精品国产亚洲av| 久久久久国色AV免费看图片| 国产亚洲成在线播放va| 区久久AAA片69亚洲| aⅴ免费在线观看| 亚洲熟妇AV一区二区三区宅男| 免费一级毛片在线播放| 成人免费一区二区三区| 亚洲精品国产情侣av在线| 成人免费777777| a毛看片免费观看视频| 亚洲国产精品张柏芝在线观看| 国产精品国产自线拍免费软件| 黄色视频在线免费观看| 亚洲天堂福利视频| 免费国产在线观看老王影院| 免费无码VA一区二区三区| 亚洲av永久无码一区二区三区| 亚洲日韩小电影在线观看| 黄瓜视频影院在线观看免费| 男女作爱免费网站| 亚洲国产日韩女人aaaaaa毛片在线|