Reference: http://blog.csdn.net/mycwq/article/details/24488691
- Installation of Cmake,mysql 5.5 to be compiled with CMake
In the newly installed CentOS 5.7 system, the first installation of Nginx (with Nginx must rely on: gzip module needs zlib library; Rewrite module requires Pcre library; The SSL feature requires the OpenSSL library), resulting in the installation cmake process. Bootstrap this step can not be passed, the reason is unknown. After the VM snapshot recovery to not install Nginx before the smooth installation of CMake.
Installation steps:
- Official website Download http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz
- Tar zxvf cmake-2.8.10.2.tar.gz
- CD cmake-2.8.10.2
- ./bootstrap
- Make
- Make install
- Cmake–h Verifying installation Results
- Start installing MySQL
Official website Download source installation package: https://cdn.mysql.com//Downloads/MySQL-5.5/mysql-5.5.57.tar.gz
Install MySQL
- [Email protected] ~]# wget http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.37.tar.gz
- [Email protected] ~]# tar xvf mysql-5.5.37.tar.gz
- [Email protected] ~]# CD mysql-5.5.37
- [Email protected] mysql-5.5.37]# CMake.
It's probably going to be a mistake, not a jump.
- CMake Error at cmake/readline.cmake:83 (MESSAGE):
- Curses Library not found. Pleaseinstall appropriate package,
- Remove CMakeCache.txt and rerun CMake. On Debian/ubuntu, package name Islibncurses5-dev, on Redhat and derivates it is ncurses-devel.
- Call Stack (most recent call first):
- cmake/readline.cmake:127 (find_curses)
- cmake/readline.cmake:217 (Mysql_use_bundled_libedit)
- cmakelists.txt:355 (mysql_check_readline
- --Configuring incomplete, Errors occurred!
- See also "/root/my/mysql-5.5.37/cmakefiles/cmakeoutput.log".
- See also "/root/my/mysql-5.5.37/cmakefiles/cmakeerror.log".
Stating that the CentOS system is not ncurses-devel
- [Email protected] ~]# wget http://invisible-island.net/datafiles/release/ncurses.tar.gz
- [Email protected] ~]# CD ncurses-5.9
- [Email protected] Ncurses-5.9]#./configure
- [[email protected] ncurses-5.9]# make
- [[email protected] ncurses-5.9]# make install
Then delete the CMakeCache.txt file that you just compiled, or you cannot proceed to the next step
- [Email protected] mysql-5.5.37]# rm-f CMakeCache.txt
Continue compiling MySQL
- [Email protected] ~]# CMake.
- [[email protected] ~]# make
- [[email protected] ~]# make install
This way, MySQL will install successfully to/usr/local/mysql by default
Create a MySQL user group
- [[email protected] ~]# Groupadd MySQL
- [[email protected] ~]# useradd–r–g MySQL MySQL
- [Email protected] ~]# chown–r mysql.mysql/usr/local/mysql
Start MySQL
- [Email protected] ~]#/usr/local/mysql/bin/mysqld_safe--user=mysql
There may be an error, no skipping:
- FATAL Error:could not Find./bin/my_print_defaults
- If you compiled from source, you need Torun "make install" to
- Copy the software into the correct locationready for operation.
- If you is using a binary release, you Musteither is at the top
- Level of the extracted archive, or pass the--BASEDIR option
- Pointing to the location.
Workaround:
- [Email protected] ~]#/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/ Usr/local/mysql/data
Start MySQL again
- [Email protected] ~]#/usr/local/mysql/bin/mysqld_safe--user=mysql
Register MySQL service, boot automatically
1. Set up MySQL configuration file to/etc directory
- [Email protected] ~]# CP/USR/LOCAL/MYSQL/SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF
2. Set up MySQL Boot
- [Email protected] ~]# Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysql
- [Email protected] ~]# chmod +x/etc/init.d/mysql
- [[email protected] ~]#/sbin/chkconfig--add MySQL
3. Start the MySQL service
- [[Email protected] ~]# service MySQL start
Test if MySQL is installed successfully
- [Email protected] ~]#/usr/local/mysql/bin/mysql-u root-p
- Enter Password:
- Welcome to the MySQL Monitor. Commands End With; or \g.
- Your MySQL Connection ID is 1
- Server version:5.5.37 Source Distribution
- Copyright (c) and/or, Oracle, Itsaffiliates. All rights reserved.
- Oracle is a registered trademark of oraclecorporation and/or its
- Affiliates. Other names trademarksof their respective
- Owners.
- Type ' help ', ' or ' \h ' for help. Type ' \c ' toclear the current input statement.
- mysql> show databases;
- +--------------------+
- | Database |
- +--------------------+
- | Information_schema |
- | MySQL |
- | Performance_schema |
- | Test |
- +--------------------+
- 4 rows in Set (0.03 sec)
Reference:
http://blog.csdn.net/mycwq/article/details/24488691
Last error when starting MySQL, the serverquit without updating PID file error occurred
Resolution process: http://blog.sina.com.cn/s/blog_637e04c9010117ri.html
[Email protected] ~]# Cd/usr/local/mysql
[Email protected] mysql]# chown-r mysql.mysql.
[Email protected] mysql]# Su-mysql
[Email protected] ~]$ Cd/usr/local/mysql
[Email protected] mysql]$ scripts/mysql_install_db
Installing MySQL system tables ...
Ok
Filling Help Tables ...
Ok
To start mysqld at boot time youhave to copy
Support-files/mysql.server to the right place for your system
REMEMBER to SET A passwordfor the MySQL root USER!
To does so, start the server, then issue the following commands:
./bin/mysqladmin-u root password ' new-password '
./bin/mysqladmin-u root-h localhost.localdomain password ' new-password '
Alternatively you can run:
./bin/mysql_secure_installation
Which would also give you the optionof removing the test
Databases and anonymous user created by default. This is
Strongly recommended for production servers.
See the Manual for Moreinstructions.
You can start the MySQL daemonwith:
Cd. ;./bin/mysqld_safe &
You can test the MySQL daemon withmysql-test-run.pl
CD./mysql-test; Perl mysql-test-run.pl
Problems with The./bin/mysqlbug script!
[Email protected] mysql]$/usr/local/mysql/bin/mysqld_safe--user=mysql &
[1] 11767
[Email protected] mysql]$ 120502 07:01:17 mysqld_safe Logging to '/usr/local/mysql/data/localhost.localdomain.err '.
120502 07:01:17 Mysqld_safe starting mysqld daemon with databases From/usr/local/mysql/data
[Email protected] mysql]$/etc/rc.d/init.d/mysql status
MySQL running (11830) [OK]
[[email protected] mysql]$/etc/rc.d/init.d/mysql start
Startingmysql [OK]
Finally here $/etc/rc.d/init.d/mysqlstart may need to be cut back to the root user to start successfully
Additional configuration
If the non-local environment cannot log on to MySQL, make the following changes
Firewall open 3306 port in 1.Centos:
-A input-p tcp-m tcp--dport 3306-j ACCEPT
2.Mysql allows the root user to log on any IP:
Update user sethost= "%" where user= "root";
3. mysql Cancel table name is case-sensitive
Modify/ETC/MY.CNF: Under the [Mysqld] node, add a line: Lower_case_table_names=1
4. Import the. sql file using the Mysql-workbench tool
MySQL 5 source installation complete process record under CentOS