国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數(shù)據(jù)庫 > MySQL > 正文

CentOS 6 下RPM方式裝置MySQL5.6

2024-07-24 12:31:31
字體:
供稿:網(wǎng)友
       CentOS 6 下RPM方式裝置MySQL5.6:

1. 下載Linux對應(yīng)的RPM包,如:CentOS6.7_64對應(yīng)的RPM包,如下:
      [root@mysql ~]# ll
      總用量 113808
-rw-------. 1 root root     1434 12月 13 18:47 anaconda-ks.cfg
-rw-r--r--. 1 root root    42556 12月 13 18:47 install.log
-rw-r--r--. 1 root root    10033 12月 13 18:45 install.log.syslog
-rw-r--r--. 1 root root 23135399 12月 13 18:56 MySQL-client-5.6.25-1.linux_glibc2.5.x86_64.rpm
-rw-r--r--. 1 root root  4586217 12月 13 18:56 MySQL-devel-5.6.25-1.linux_glibc2.5.x86_64.rpm
-rw-r--r--. 1 root root 88715219 12月 13 18:56 MySQL-server-5.6.25-1.linux_glibc2.5.x86_64.rpm
2. 檢查MySQL及相關(guān)RPM包,是否安裝,如果有安裝,則移除(rpm –e 名稱)
      [root@mysql ~]# rpm -qa | grep -i mysql
      mysql-libs-5.1.73-5.el6_6.x86_64
      [root@mysql ~]# rpm -ev mysql-libs-5.1.73-5.el6_6.x86_64 --nodeps
3. 安裝MySQL
[root@mysql ~]# rpm -ivh MySQL-server-5.6.25-1.linux_glibc2.5.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-server           ########################################### [100%]
warning: user mysql does not exist - using root
warning: group mysql does not exist - using root
Support MySQL by buying support/licenses at http://shop.mysql.com
New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings
[root@mysql ~]# rpm -ivh MySQL-devel-5.6.25-1.linux_glibc2.5.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-devel            ########################################### [100%]
[root@mysql ~]# rpm -ivh MySQL-client-5.6.25-1.linux_glibc2.5.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-client           ########################################### [100%]
4. 初始化MySQL及設(shè)置密碼
[root@mysql ~]# /usr/bin/mysql_install_db             -- mysql_install_db腳本來生成帳戶和相應(yīng)權(quán)限許可表
WARNING: The host 'mysql' could not be looked up with /usr/bin/resolveip.
This probably means that your libc libraries are not 100 % compatible
。。省略輸出。。
WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server
[root@mysql ~]# service mysql start
Starting MySQL. SUCCESS!
[root@mysql ~]# cat /root/.mysql_secret    --查看root賬號密碼
# The random password set for the root user at Tue Dec 13 18:59:06 2016 (local time): 7MhtyX3aZEl9OUf8
[root@mysql ~]# mysql -uroot -p
Enter password:               --(此處復(fù)制粘貼 7MhtyX3aZEl9OUf8)
Welcome to the MySQL monitor.  Commands end with ; or /g.
Your MySQL connection id is 2
Server version: 5.6.2
Copyright (c) 2000, 2015, 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.
說明:  出現(xiàn)mysql>   表示一切順利成功。
mysql> SET PASSWORD = PASSWORD('123456');   --設(shè)置密碼為123456
5.   更改MySQL目錄與字符集
[root@mysql01 /]# cd /
[root@mysql01 /]# mkdir data    #建立data目錄
[root@mysql01 /]#  service mysql stop
Shutting down MySQL....                                    [  OK  ]
[root@mysql01 /]# mv /var/lib/mysql  /data   #把/var/lib/mysql整個目錄移到/home/data
[root@mysql01 /]#  mkdir -p /data/mysql/binarylog
[root@mysql01 /]# chown -R mysql:mysql /data/mysql
 
如果/etc/目錄下沒有my.cnf配置文件,請到/usr/share/mysql/下找到*.cnf文件,拷貝其中一個到/etc/并改名為my.cnf中
[root@mysql ~]# cp /usr/share/mysql/my-default.cnf /etc/my.cnf    --修改配置文件位置
配置/etc/my.cnf文件,修改數(shù)據(jù)存放路徑、mysql.sock路徑以及默認(rèn)編碼utf-8.

(編輯:武林網(wǎng))

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 枣强县| 舒城县| 朝阳市| 神木县| 木兰县| 宁城县| 贵定县| 兖州市| 乌拉特中旗| 盐边县| 宿州市| 水城县| 昂仁县| 葫芦岛市| 抚顺县| 乌兰察布市| 阿拉善盟| 宁晋县| 吕梁市| 衡水市| 咸丰县| 嘉兴市| 旬阳县| 读书| 南昌市| 裕民县| 徐州市| 余江县| 兴和县| 淮安市| 岳阳市| 始兴县| 彭山县| 蒲城县| 三原县| 侯马市| 扶沟县| 朝阳区| 罗山县| 双峰县| 壤塘县|