mysql 5.7.14编译安装_源码编译安装mysql-5.7.14-阿里云开发者社区
1.下載并上傳 mysql-5.7.14.tar.gzview plain
tar?-zxf?msql-5.7.14.tar.gz
yum?-y?install?gcc?gcc-c++?ncurses?ncurses-devel?cmake
wget?http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz
groupadd?mysql
useradd?-r?-g?mysql?-s?/bin/false?mysql
cmake?.?\
-DCMAKE_INSTALL_PREFIX=/application/mysql-5.7.14?\
-DMYSQL_DATADIR=/application/mysql-5.7.14/data?\
-DDOWNLOAD_BOOST=1\
-DWITH_BOOST=/software/boost_1_59_0?\
-DMYSQL_UNIX_ADDR=/application/mysql-5.7.14/tmp/mysql.sock?\
-DDEFAULT_CHARSET=utf8\
-DDEFAULT_COLLATION=utf8_general_ci\
-DENABLED_LOCAL_INFILE=ON\
-DWITH_INNOBASE_STORAGE_ENGINE=1\
-DWITH_FEDERATED_STORAGE_ENGINE=1\
-DWITH_BLACKHOLE_STORAGE_ENGINE=1\
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1\
-DWITHOUT_PARTITION_STORAGE_ENGINE=1\
-DWITH_FAST_MUTEXES=1\
-DWITH_ZLIB=bundled\
-DENABLED_LOCAL_INFILE=1\
-DWITH_READLINE=1\
-DWITH_EMBEDDED_SERVER=1\
-DWITH_DEBUG=0
make
make?install
7.修改 /etc/my.cnf?view plain
[mysqld]
datadir=/application/mysql/data
socket=/application/mysql/tmp/mysql.sock
user=mysql
#?Disabling?symbolic-links?is?recommended?to?prevent?assorted?security?risks
symbolic-links=0
character_set_server=utf8
chown?-R?mysql:mysql?mysql-5.7.14/
mkdir?data
chown?mysql:mysql?data
bin/mysqld?--initialize--user=mysql--basedir=/application/mysql--datadir=/application/mysql/data
bin/mysql_ssl_rsa_setup
cp?support-files/mysql.server?/etc/init.d/mysqld
修改?mysqld?文件里的?basedir?datadir?屬性
chkconfig?mysqld?on?#?設置開機自啟動
chkconfig?--list?|?grep?mysqld
service?mysqld?start
service?mysqld?restart
service?mysqld?stop
14.登錄并修改初始密碼?copy
SET?PASSWORD?FOR?'root'@'localhost'=PASSWORD('newpassword');
Starting?MySQL...?ERROR!?The?server?quit?without?updating?PID?file?(/application/mysql/Rong.pid).
1.查看錯誤日志 /var/log/mysqld.log 檢查錯誤原因?view plain
[ERROR]?Fatal?error:?Can't?open?and?lock?privilege?tables:?Table?'mysql.user'?doesn't?exist
2.原因:在進行初始化數(shù)據(jù)庫權限表的時候默認創(chuàng)建的權限表在默認目錄/usr/local/mysql/var下面,而實際是在 /application/mysql/data
3.通過需改 /etc/my.cnf 下 --datadir參數(shù)來解決問題
本文轉(zhuǎn)自 Mr_sheng 51CTO博客,原文鏈接:http://blog.51cto.com/sf1314/2057634
總結
以上是生活随笔為你收集整理的mysql 5.7.14编译安装_源码编译安装mysql-5.7.14-阿里云开发者社区的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 代码: 0x80131500_微软应用商
- 下一篇: c++申请内存空间_有没有想过:mall