Ubuntu installs MySQL5.5 with Deb (reprint)

Source: Internet
Author: User
Tags administrator password

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

MySQL server is initialized in/opt/mysql/server-5.5

3. Enable MySQL

Groupadd MySQL

Useradd-r-G MySQL 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

Initializing the database

sudo/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/mysql/ Data

Put the Mysqld startup shell program into the system service directory

sudo cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysql

put the MySQL configuration file in the system configuration/etc directory, MySQL in global scope To use this configuration file

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 [password you wish to set]

Test if you can log in to MySQL

Sudo/usr/local/mysql/bin/mysql-u root-p [optional database name]

Mysql.sock stored in /tmp/mysql.sock

Note: If you add mysql_server to the system service directory/etc/init.d/you must ensure that the MySQL program directory is in/usr/local/mysql, which can be pointed to by means of a soft link to other really installed directories.

If you install Mysql-common after this, the configuration file for MySQL server will be affected, you will need to change the Basedir, DataDir, and log in/etc/mysql/my.cnf or modify the settings in php.ini, such as PDO

Ubuntu installs MySQL5.5 with Deb (reprint)

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.