Install MySql in a binary source package in Linux

Source: Internet
Author: User

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?
  1. // Create a MySQL user
  2. * Groupadd-G 3306 MySQL
  3. * Useradd-G mysql-u 3306-M MySQL
  4. * ID MySQL
  5. * Chown-r MYSQL: MySQL/mydata // MySQL requires write permission on the directory
  6. * Ll-D/mydata/
  7. * CP/mysql-5.5.15-linux2.6-i686/usr/local
  8. * CD/usr/local/MySQL // start MySQL Initialization
  9. * Chown-r MYSQL: MySQL.
  10. * Ln-SV/mysql-5.5.15-linux2.6-i686 for MySQL
  11. * Scripts/mysql_install_db -- user = MySQL -- datadir =/mydata/Data
  12. // <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?
  1. // The following configuration is enabled after installation is complete
  2. * Ls support-files // prepare the Service Startup Script
  3. * CP support-files/MySQL. Server/etc/init. d/mysqld // put init. d
  4. * Chkconfig -- add mysqld // Add to the service list
  5. * Chkconfig -- list mysqld // -- list is displayed.
View plainprint?
  1. // MySQL can be started at this time, but you still need to configure MySQL
  2. * Ls/etc/My. CNF
  3. * Ls support-files/
  4. * CP support-files/my-large.cnf/etc/My. CNF
  5. * Vim/etc/My. CNF
  6. [Mysqld] // locate the segment and add datadir =/mydata/Data
  7. Datadir =/mydata/Data
  8. * Service mysqld start // enable the Service
  9. * Netstat-tnl // port 3306 is enabled
  10. * Echo $ path
  11. */Usr/local/MySQL/bin/MySQL
  12. * 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.
  13. * Vim/etc/profile // Add the following path before the export
  14. Path = $ path:/usr/local/MySQL/bin // permanent effective path configuration method
  15. * MySQL // MySQL can be started now
View plainprint?
  1. // Configure the path of the MySQL database file
  2. * Ls
  3. * Vim/etc/lD. So. conf // modify the location of the Library File
  4. * Vim/etc/lD. So. conf. d/MySQL. conf // standard configuration can be configured at the End of. conf in the current directory.
  5. * Ldconfig-v | grep MySQL // Reload all database files. The path does not contain MySQL database files.
  6. Vim/etc/lD. So. conf. d/MySQL. conf
  7. /Usr/local/MySQL/lib // create a MySQL. conf file and add the content to the file.
  8. * Ldconfig-v | grep MySQL // after modification, it will be reloaded once. Otherwise, the server will not know
View plainprint?
  1. // Configure the header file
  2. 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
  3. * Ls/usr/include/
  4. * Ln-SV/usr/local/MySQL/include/usr/include/MySQL // output of the header file
  5. * Vim/etc/man
  6. * Vim/etc/man. config // Add man
  7. Manpath/usr/local/MySQL/man
  8. OK! MySQL configuration successful ---

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.