Ubuntu uses Deb to install MySQL 5.5

Source: Internet
Author: User
Document directory
  • 1. Download the MySQL 5.5 Deb installation package
  • 2. Install the Deb package
  • 3. Enabling MySQL
1. Download the MySQL 5.5 Deb installation package

CD/usr/local/src

Sudo wget-O mysql-5.5.22-debian6.0-i686.deb http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.22-debian6.0-i686.deb/from/http://mysql.ntu.edu.tw/

 

2. Install the Deb package

Sudo dpkg-I mysql-5.5.22-debian6.0-i686.deb

The MySQL server is initialized at/opt/MySQL/Server-5.5.

 

3. Enabling MySQL

Groupadd MySQL

Useradd-r-g MySQL

Sudo apt-Get install libaio-Dev

Ln-S/opt/MySQL/Server-5.5/usr/local/MySQL

Sudo mkdir/usr/local/MySQL/Data

Sudo chown-r mysql./usr/local/MySQL/Data

 

Initialize Database

Sudo/usr/local/MySQL/scripts/mysql_install_db -- user = MySQL -- basedir =/usr/local/MySQL -- datadir =/usr/local/MySQL/Data

Put the startup shell program of mysqld in the system service directory.

Sudo CP/usr/local/MySQL/support-files/MySQL. Server/etc/init. d/MySQL

Put the MySQL configuration file in the/etc directory of the System Configuration. MySQL should use this configuration file in the global scope.

Sudo CP/usr/local/MySQL/support-files/my-medium.cnf/etc/My. CNF

 

Start MySQL

Sudo/etc/init. d/MySQL start

 

Change the MySQL root administrator password

Sudo/usr/local/MySQL/bin/mysqladmin-u Root Password [the password you want to set]

 

Test whether you can log on to MySQL

Sudo/usr/local/MySQL/bin/MySQL-u root-P [Optional database name]

 

MySQL. Sock is stored in/tmp/MySQL. Sock

Note: If you add mysql_server to the system service directory/etc/init. d/must ensure that the MySQL program directory is in/usr/local/MySQL. You can use soft links to direct to other installation directories.

 

If mysql-common is installed later, the configuration file of MySQL server will be affected. You need to change the/etc/MySQL/My. basedir, datadir, and log in CNF or modify PHP. settings in ini, such as PDO

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.