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.
View plainprint?
- // Create a MySQL user
- * Groupadd-G 3306 MySQL
- * Useradd-G mysql-u 3306-M MySQL
- * ID MySQL
- * Chown-r MYSQL: MySQL/mydata // MySQL requires write permission on the directory
- * Ll-D/mydata/
- * CP/mysql-5.5.15-linux2.6-i686/usr/local
- * CD/usr/local/MySQL // start MySQL Initialization
- * 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.
View plainprint?
- // 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 // -- list is displayed.
View plainprint?
- // 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 segment and add datadir =/mydata/Data
- Datadir =/mydata/Data
- * Service mysqld start // enable the Service
- * Netstat-tnl // port 3306 is enabled
- * Echo $ path
- */Usr/local/MySQL/bin/MySQL
- * Export Path = $ path:/usr/local/MySQL/bin // <span style = "color: # cc6600;"> note </span>: if you do not add $, only the path you added is left.
- * 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
View plainprint?
- // 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 // standard configuration can be configured at the End of. conf in the current directory.
- * Ldconfig-v | grep MySQL // Reload all database files. The path does not contain MySQL database files.
- Vim/etc/lD. So. conf. d/MySQL. conf
- /Usr/local/MySQL/lib // create a MySQL. conf file and add the content to the file.
- * Ldconfig-v | grep MySQL // after modification, it will be reloaded once. Otherwise, the server will not know
View plainprint?
- // 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 ---