Install the first Binary source code ready, you can download from the image Sohu: http://mirrors.sohu.com/
My website is mysql-5.5.15-linux2.6-i686.tar.gz,Linux version 2.6.18-164. el5
In actual work, the configurations of virtual machines may be different in some places.
========================================================== ======================================
Note:: You must specify/usr/local as mysql during mysql installation.
To install the Binary source code, run it in the installation directory/usr/local.
- // Create a mysql user
- * Groupadd-g 3306 mysql
- * Useradd-g mysql-u 3306-M mysql
- * Id mysql
- * Chown-R mysql: mysql/mydata/// Mysql requires the write permission on the directory
- * Ll-d/mydata/
- * Cp/mysql-5.5.15-linux2.6-i686/usr/local
- * Cd/usr/local/mysql// Start initializing mysql
- * Chown-R mysql: mysql.
- * Ln-sv/mysql-5.5.15-linux2.6-i686 for mysql
- * Scripts/mysql_install_db -- user = mysql -- datadir =/mydata/data
- // <Span style = "color: #993300;"> scripts script initialization </span> is used to generate a mysql database to store table and other source data information.
- // The following configuration is enabled after installation is complete
- * Ls support-files/// Prepare the Service Startup Script
- * Cp support-files/mysql. server/etc/init. d/mysqld// Put init. d
- * Chkconfig -- add mysqld// Add to the service list
- * Chkconfig -- list mysqld// -- Display the list
- // Mysql can be started at this time, but you still need to configure mysql
- * Ls/etc/my. cnf
- * Ls support-files/
- * Cp support-files/my-large.cnf/etc/my. cnf
- * Vim/etc/my. cnf
- [Mysqld]// Locate the section and add datadir =/mydata/data
- Datadir =/mydata/data
- * Service mysqld start// Enable the Service
- * Netstat-tnl// Open port 3306
- * Echo $ PATH
- */Usr/local/mysql/bin/mysql
- * Export PATH = $ PATH:/usr/local/mysql/bin// <Span style = "color: # cc6600;"> note </span>: the path you added is left without $.
- * Vim/etc/profile// Add the following path before the export
- PATH = $ PATH:/usr/local/mysql/bin// Permanent effective path configuration method
- * Mysql// Mysql can be started now
- // Configure the path of the mysql database file
- * Ls
- * Vim/etc/ld. so. conf// Modify the location of the Library File
- * Vim/etc/ld. so. conf. d/mysql. conf// The standard configuration can be configured at the End of. CONF in the current directory.
- * Ldconfig-v | grep mysql// Reload all database files without mysql database files in the path
- Vim/etc/ld. so. conf. d/mysql. conf
- /Usr/local/mysql/lib// Create a new mysql. conf file and add the content to the file.
- * Ldconfig-v | grep mysql// After modification, reload the file once. Otherwise, the server will not know.
- // Configure the header file
- What functions are available in the library file and how to call the function when writing a program? How to pass the parameter type? What is the return value? What is the header file corresponding to the library file? in/usr/include
- * Ls/usr/include/
- * Ln-sv/usr/local/mysql/include/usr/include/mysql// Output of the header file
- * Vim/etc/man
- * Vim/etc/man. config// Add Man
- MANPATH/usr/local/mysql/man
- OK! Mysql configuration successful ---