Linux Non-root users install MySQL

Source: Internet
Author: User

1. First, install the package mysql-5.1.28-rc.tar.gz for wget mysql, compile with configure before version 5.1, and compile with cmake for Versions later than version 5.1.

Extract mysql-5.1.28-rc.tar.gz

Tar-axvf mysql-5.1.28-rc.tar.gz

2. Enter the decompressed folder cd mysql-5.1.28-rc

3. Compile $./configure -- prefix =/* directory to be installed/mysql -- with-charset = utf8 -- with-plugins = innobase

Example: $./configure -- prefix = $ HOME/mysql -- with-charset = utf8 -- with-plugins = innobase

** ===================================================== ============== **

How to solve the problem of configure: error: No curses/termcap library found during Mysql Compilation

It indicates that the curses/termcap library is not installed.

Root install ncurses (or compile and install ncurses, And then./configure during compilation -- with specifies the lib path)

** ===================================================== ============== **

4. $ make

$ Make install

5. Copy a configuration file to the mysql installation directory and rename it my. cnf.

Find the my-medium.cnf Under share/mysql/Under the installation directory, copy it to the installation directory and rename it to my. cnf

6. Modify the my. cnf File

Socket =/*** directory to be installed/mysql. sock (the default value is/tmp/mysql. sock because we are common users and cannot operate/tmp/, mysql. the sock file is automatically generated when mysql is started. Pay attention to the log information during startup. If an error is reported, check the error log in the var directory under the mysql installation directory to find the cause)

Basedir =/installation path/mysql

Datadir =/installation path/mysql/var

7. initialize database tables

Installation directory/bin/mysql_install_db -- user = mysql -- datadir =/installation path/mysql/var

Example: $./mysql/bin/mysql_install_db -- user = mysql -- datadir = $ HOME/mysql/var

8. Start the mysql Service

/Installation path/bin/mysqld_safe -- defaults-file =/installation path/my. cnf

Example: $./mysql/bin/mysqld_safe -- defaults-file = $ HOME/mysql/my. cnf

9. Enter the mysql database

/Installation path/bin/mysql-S/installation path/mysql. sock

For example, $./mysql/bin/mysql-S $ HOME/mysql. sock or

./Mysql/bin/mysql-h '2017. 0.0.1 '-u root-p

10. Modify the root user password

$./Mysql/bin/mysqladmin-h '2017. 0.0.1 '-u root password 127

Related Article

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.