debian7 compile mysql5.6.12.txt

来源:互联网 发布:苹果cms如何添加采集 编辑:程序博客网 时间:2024/05/20 11:23
#Compile mysql-5.6.12
 
groupadd mysql
useradd -g mysql mysql
 
./configure --prefix=/usr/local/mysql
#error ./configure: command not found
 
sudo apt-get install cmake
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_TCP_PORT=3306 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock
 
#error Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
#CMake Error at cmake/readline.cmake:85 (MESSAGE):
#Curses library not found. Please install appropriate package,
#remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
sudo apt-get install libncurses5-dev
rm -f CMakeCache.txt
 
make
make install
 
sudo cp support-files/my-default.cnf /etc/my.cnf
sudo cp support-files/mysql.server /etc/init.d/mysql
sudo chmod 775 /etc/init.d/mysql
 
chown -R mysql:mysql .
 
./scripts/mysql_install_db --user=mysql --datadir=/var/lib/mysql
 
#error
#FATAL ERROR: Could not find ./bin/my_print_defaults
 
#If you compiled from source, you need to run 'make install' to
#copy the software into the correct location ready for operation.
 
#If you are using a binary release, you must either be at the top
#level of the extracted archive, or pass the --basedir option
#pointing to that location.
 
#fix
# which my_print_defaults
/usr/local/mysql/bin/my_print_defaults
 
./scripts/mysql_install_db --basedir=/usr/local/mysql --user=mysql --datadir=/var/lib/mysql
 
/etc/init.d/mysql restart
 
#error
#[FAIL] MySQL server PID file could not be found! ... failed!
#Starting MySQL
#[FAIL..] The server quit without updating PID file (/usr/local/mysql/data/pomelo.pid). ... failed!
 
sudo tail -f /usr/local/mysql/data/pomelo.err
 
#2013-06-06 01:40:52 20561 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
 
#Fix
#Check valid params on my.cnf
 
 
./bin/mysqladmin -u root password '123' #change password
0 0
原创粉丝点击