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

歡迎訪問 生活随笔!

生活随笔

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

数据库

centos mysql 5.6.19_Centos5.8 安装 MySQL5.6.19

發布時間:2024/9/18 数据库 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 centos mysql 5.6.19_Centos5.8 安装 MySQL5.6.19 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

查看已經安裝的mysql:

sudo yum list installed |grep mysql

刪除

sudo yum remove mysql

安裝

sudo rpm -ivh MySQL-server-5.6.19-1.rhel5.x86_64.rpm

會發現mysql已經被添加到/etc/init.d/

查看服務狀態

sudo /sbin/service mysql status

啟動服務

sudo /sbin/service mysql start

ps查看, 服務運行在mysql用戶下,

檢查啟動參數

sudo /sbin/chkconfig –list mysql

mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off

已經添加到系統自啟動

my.cnf在 /usr 下, 添加以下基本參數

join_buffer_size = 64M

sort_buffer_size = 4M

read_rnd_buffer_size = 4M

key_buffer_size=16M

max_allowed_packet=16M

修改默認端口會遇到selinux的權限問題, 具體可以看

https://blogs.oracle.com/jsmyth/entry/selinux_and_mysql

可以通過 sudo /usr/sbin/semanage port -l 查看當前的端口狀態

semanage port -a -t mysqld_port_t -p tcp 6033

就可以指定其他端口了

#########

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !

You will find that password in ‘/home/milton/.mysql_secret’.

You must change that password on your first connect,

no other statement but ‘SET PASSWORD’ will be accepted.

See the manual for the semantics of the ‘password expired’ flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.

This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

http://www.mysql.com

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

#########

編譯安裝

需要預先安裝ncurses-devel, 否則會報錯”Curses library not found”.

sudo yum install ncurses-devel

cmake需要用root權限運行:

sudo cmake -DCMAKE_INSTALL_PREFIX=/opt/mysql

-DMYSQL_DATADIR=/opt/mysql/data -DWITH_INNOBASE_STORAGE_ENGINE=1

-DMYSQL_TCP_PORT=6033 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8

-DDEFAULT_COLLATION=utf8_general_ci

添加用戶和組

shell> sudo groupadd mysql

shell> sudo useradd -r -g mysql mysql

# cd /opt/mysql

# sudo chown -R mysql .

# sudo chgrp -R mysql .

安裝測試數據

# sudo scripts/mysql_install_db –user=mysql

顯示如下:

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

./bin/mysqladmin -u root password ‘new-password’

./bin/mysqladmin -u root -h ML-M0 password ‘new-password’

Alternatively you can run:

./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.

You can start the MySQL daemon with:

cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

cd mysql-test ; perl mysql-test-run.pl

New default config file was created as ./my.cnf and

will be used by default by the server when you start it.

You may edit this file to change server settings

再修改用戶

# sudo chown -R root .

# sudo chown -R mysql data

啟動服務

# sudo bin/mysqld_safe –user=mysql &

添加到系統啟動

# sudo cp support-files/mysql.server /etc/rc.d/init.d/mysqld

# sudo chkconfig --add mysqld

Centos 6.3 壓縮包安裝MySQL5.6.2x

# cd /opt/mysql

#tar zxvf mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz

#ln -s mysql-advanced-5.6.23-linux-glibc2.5-x86_64 mysql

# cd mysql

#--- install &init

#sudo chown -R mysql:mysql .

#sudo ./scripts/mysql_install_db --user=mysql

#---start the server (這邊加 --user=mysql 的時候不成功, 后來不加這個才正常啟動的)

#sudo ./bin/mysqld_safe &[1] 3492[root@racnote1 mysql]#150324 16:33:40 mysqld_safe Logging to '/usr/local/mysql/data/racnote1.err'.150324 16:33:40 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

Ctrl+C

#---add it to the service

#sudo cp support-files/mysql.server /etc/init.d/mysql.server

#sudo vi /etc/init.d/mysql.serverfind "basedir=", add the path to mysql installation, e.g. "basedir=/opt/mysql/mysql"#sudo chkconfig --list

#sudo chkconfig --add mysql.server

#sudo chkconfig --list

#---initialize the root password

#sudo ./bin/mysql_secure_installation

#--- link the mysql executable to /usr/bin

# cd/usr/local/bin

#sudo ln -s /opt/mysql/mysql/bin/mysql mysql

總結

以上是生活随笔為你收集整理的centos mysql 5.6.19_Centos5.8 安装 MySQL5.6.19的全部內容,希望文章能夠幫你解決所遇到的問題。

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