1. The operating system is Centos6.3_64-bit, and the package that needs to be installed is as follows:
lua-5.1.5
cmake-2.8.7
mysql-5.5.23
mysql++- 3.1.0
boost_1_49_0
tar -xzvf lua-5.1.5.tar.gz
cd lua-5.1.5
and then execute make, it will prompt you to enter the make system, because my system is linux, So enter make linux
2, compile and install boost
#tar -zxvf boost_1_49_0.tar.gz
#cd boost_1_49_0
#./bootstrap.sh
#./b2
3. MYSQL5.5 installation steps:
#tar zxvf cmake-2.8.7.tar.gz -C /usr/local/src/
#tar zxvf mysql-5.5.23.tar.gz -C /usr/local/src/
# cd /usr/local/src/cmake-2.8.7/
# ./configure
# gmake && make install
# cd .. /mysql-5.5.23/
# mkdir -p /data/mysql
# useradd -u 27 -d /data/mysql/ -s /sbin/nologin mysql for the
MySQL
data file
# id mysql
uid=27(mysql) gid=27(mysql) groups=27(mysql)
# chown -R mysql:mysql /data/mysql/
# ls -ld /data/mysql/
drwxr-xr-x 2 mysql mysql 4096 07-11 03:56 /data/mysql/
# yum install -y ncurses-devel
# rm -f CMakeCache.txt (If you want to do this later with ncurses-devel installed with yum, In the next step)
# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/data/mysql/ -DWITH_EXTRA_CHARSETS=all - DWITH_READLINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_TCP_PORT=3306 -DDEFAULT_COLLATION=utf8_general_ci The
above command must be executed in the mysql-5.5.11 directory!!
-DCMAKE_INSTALL_PREFIX MySQL installation path
-DDEFAULT_CHARSET character set
-DMYSQL_DATADIR Data save path
-DMYSQL_TCP_PORT port
# make&& make install
# cd /usr/local/mysql/
# ls
bin data include lib mysql-test scripts sql-bench
COPYING docs INSTALL-BINARY man README share support-files
# cd support-files/
# cp my-medium.cnf /etc/my.cnf
Generate MySQL configuration file
# pwd
/usr/local/mysql
# cd scripts/
# ls
mysql_install_db
# vim /etc/my.conf
with two lines
after [mysqld] skip-name-resolve
innodb_flush_log_at_trx_commit = 2
Initialize the database:
# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/data/mysql/
Installing MySQL system tables...
OK
Filling help tables...
OK
# vim /etc/my.cnf
[mysqld]
datadir = /data/mysql to add, specify the data storage location
# pwd
/usr/local/ mysql/support-files
# cp mysql.server /etc/init.d/mysqld
Copy the MySQL startup script
# /etc/init.d/mysqld start
# pwd
/usr/local/mysql/bin
# ./mysql
mysql>
# vim /etc/profile
export PATH=/usr/ local/mysql/bin:$PATH add
# . /etc/profile
Start mysql:
/etc/init.d/mysqld start
chkconfig --add mysqld
chkconfig mysqld on
# mysql
mysql>
9. mysql++ install
tar -zxvf mysql++-3.1.0.tar.gz
cd mysql++-3.1.0
./configure
make install
# pwd
/root/mysql++-3.1.0
#vim ssx/genv2.cpp According to the error, find the corresponding location in this file, and add the
command at the bottom
#include <iostream>
#include <fstream>
#include <typeinfo>
#include <string.h>
Fix the program startup error:
ln -s /usr/local/mysql/lib/ libmysqlclient.so.18 /usr/lib/
mysql> select user,host,password from mysql.user; View user information
+------+------------+-------------------------------------------+
| user | host | password |
+------+------------+-------------------------------------------+
| root | localhost | |
| root | 10-6-3-176 | |
| root | 127.0.0.1 | |
| root | % | |
+------+------------+-------------------------------------------+
4 rows in set (0.00 sec)
mysql> set password for root@localhost=password('XXXXXXX');
Set root password
mysql> set password for root@'10-6-6-23'=password('XXXXXXXX');
mysql> grant all on *.* to root@"%" identified by 'XXXXXXXX';
Authorize
mysql> select user,host,password from mysql.user;
+------+------------+-------------------------------------------+
| user | host | password |
+------+------------+-------------------------------------------+
| root | localhost | *C07583ABFCBBCC5D64C9469E28D4861951C5024A |
| root | 10-6-3-176 | *C07583ABFCBBCC5D64C9469E28D4861951C5024A |
| root | 127.0.0.1 | |
| root | % | *4F048907E92401E909B60D4C90426C4D3AEB499D |
+------+------------+-------------------------------------------+
4 rows in set (0.00 sec)
mysql> delete from mysql.user where user=''; delete anonymous
user
mysql> grant select on uctot.* to small user @'%' identified by "XXXXXXXX";
authorize
mysql> show grants for root@"%"; See what permissions
the user has
mysql> grant select on *.* to chinatot@"%" identified by 'XXXXXXXXX';
mysql> flush privileges;
mysql> exit