Ubuntu install MySQL

Source: Internet
Author: User
Tags mysql client

1. Installing Cmake:sudo apt-get Install CMake

2. Installing MySQL5.5

A) Download: sudo wget http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.40.tar.gz

b) Unzip and enter the directory: sudo tar zxvf mysql-5.5.40.tar.gz && CD mysql-5.5.40

c) Compile and install:

CMake. -dcmake_install_prefix=/usr/local/mysql/-dmysql_datadir=/root/mysql/data/-dmysql_unix_addr=/tmp/mysqld.sock- Dwith_innobase_storage_engine=1-denabled_local_infile=1-dmysql_tcp_port=3306-dextra_charsets=all-ddefault_ Charset=utf8-ddefault_collation=utf8_general_ci-dmysql_unix_addr=/tmp/mysql.sock-dmysql_user=mysql-dwith_debug =0

D) Make

e) make install

f) configuration

sudo cp support-files/my-medium.cnf/etc/my.cnf

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

sudo chmod 755/etc/init.d/mysqld

e) Initialize MySQL

    1. Groupadd MySQL//create MySQL Group
    2. useradd-g MySQL mysql//create MySQL user to add to MySQL group
    3. sudo sh./scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql/--datadir=/home/wkubuntu/mysql/data/

Third, start and stop MySQL

Sudo/etc/init.d/mysqld start

Sudo/etc/init.d/mysqld stop

"Mysql:starting MySQL ..... error! The server quit without updating PID file solution "

cd/usr/local/mysql/

Chown-r Mysql:mysql.

[Email protected] mysql]# Su-mysql

[Email protected] ~]$ Cd/usr/local/mysql

[Email protected] mysql]$ scripts/mysql_install_db

/usr/local/mysql/bin/mysqld_safe--user=mysql &

b) Install the connection to the MySQL client

sudo apt-get install mysql-client

c) Connect MySQL test

Mysql–u Root

-------------------------------------------

The program ' MySQL ' Can is found in the following Packages: 
* Mysql-server-core-5.1 
* Mysql-cluster-server-5.1 
* Mysql-server-core-5.0 
Try: Apt-get Install <selected package>&NBSP;

not really wrong. &NBSP;

is compiled to install MySQL &NBSP;

mysql/ The bin directory is not added to path inside &NBSP;

So to CD to Mysql/bin directory then ./mysql  or. bin/ Mysql-uroot-p

"Note: Go directly to the catalogue cd/usr/local/and then sudo./mysql-uroot-p"

Ubuntu install MySQL

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.