In linux, how does one install the MySQL source code manually?

Source: Internet
Author: User

The following article describes how to install the MySQL source code in a linux operating system manually. We installed the MySQL source code in the suse10 desktop environment, if you are interested in the actual manual Installation Process of MySQL source code in linux, you may wish to browse the following articles.

Bytes

2. Decompress tar-xvf MySQL-5.0.87.tar.gz

3. Enter MySQL-5.0.87

4. Check the environment and specify the installation directory:./configure -- prefix =/usr/local/MySQL

It is detected that everything is missing. I didn't even have gcc or g ++ when installing it. If there is no compiler, I need to directly download the compiled binary file of the rpm package) and then install it on the system.

The following is the command to install gcc (to download this package first, this address has a lot of rpm package download http://mirror.oa.com/SLES10-SP1-RPMS-32 ):

Sudo rpm-ivh gcc-4.1.2_20070115-0.11.i586.rpm

Some of these rpm packages are installed, or they cannot be installed because they are dependent on themselves. If they cannot be installed, use the command to force installation and ignore dependencies.

Sudo rpm-ivh gcc-4.1.2_20070115-0.11.i586.rpm -- force-nodeps

After installing a series of rmp packages, the Environment check is completed. I have installed more than 10 rmp packages .. Cup

5. Compile: make

6. install: sudo make install

7. configuration is required during installation of MySQL source code in linux. First, you can see the following directory after installation:

Run the following command in share/MySQL: ls-l | grep my-

All MySQL configuration files are displayed. select one of them as needed and copy them to/etc and name them my. cnf.

/Etc/my. cnf is the path of the configuration file read by MySQL by default.

8. Modify the write permission of var. This is the location where MySQL database data files are stored, because the background program running MySQL by the current user may not have the write permission for this directory.

Chmod 777./var-r

9. configure system environment variables so that MySQL programs can be directly executed.

The system environment variables are stored in/etc/profile, and the user's environment variables are stored in. bashrc under the user's root directory.

(1)/etc/profile configuration:

 
 
  1. PATH=/usr/local/MySQL/bin:$PATH  
  2. PATH=/usr/local/MySQL/libexec:$PATH 

In the export PATH,/usr/local/mydql/bin is the main executable program directory of MySQL, while libexec is the configuration of MySQL background main program MySQLd (2). bashrc:

 
 
  1. set PATH=/usr/local/MySQL/bin:$PATH  
  2. set PATH=/usr/local/MySQL/libexec:$PATH 

Export PATH. Note that a set must be added to bashrc. After the configuration is complete, re-login will take effect.

10. initialize MySQLd and execute MySQL_install_db.

11. Start MySQLd and press MySQLd directly, because the system environment variables have been configured before.

12. directly access MySQL Command Line Control. The default logon mode is the current user name. The default root mode has no password.

13. Set the root password: MySQLadmin-u root password '123'

14. Log On As root: MySQL-uroot-p

15. Set remote database logon. After a user is created, the user can only log on locally by default.

 
 
  1. update user set Host='%’ where user=‘kuncai'; 

Change the permitted logon address of the kuncai user to any address, but not local. That is to say, the kuncai user cannot log on locally and can only log on remotely.

Only the root user can execute this statement. Therefore, you must first log on to the local database as the root user.

 
 
  1. flush privileges; 

This refresh cache statement takes effect. The above content is an introduction to the installation of manual MySQL source code in linux. I hope you will have some gains.

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.