怎樣安裝在ubuntu12.04上安裝mysql

edagarli發表於2014-03-21

Abstract

MySQL is the most trusted and depended-on open source database platform in use today. As such, 9 out of the top 10 most popular and highly trafficked websites in the world rely on MySQL primarily due to its ubiquity across heterogeneous platforms and application stacks and for its well-known performance, reliability and ease of use. This blog entry will guide you through the step-by-step installation of MySQL 5.5 on Ubuntu Linux 12.04 LTS 32 bit. This installation is performed on a clean installation of Ubuntu Server 12.04 32 bit.

Step 1: Open your Terminal

Press the following keyboard shortcut:

1
Ctrl + Alt + T

Step 2: Update your package cache

Run the following command in your terminal:

1
sudoapt-get update

Step 3: Install the mysql-server-5.5 package

Run the following command in your terminal:

1
sudoapt-get installmysql-server-5.5

Step 4: Create a new MySQL database

Run the following commands in your terminal, replacing newdatabasenewuser andnewpassword:

1
2
3
4
mysql -u root -p
CREATE DATABASE newdatabase;
GRANT ALL PRIVILEGES ON newdatabase.* TO newuser@localhost IDENTIFIED BY 'newpassword';
Press CTRL + D

Step 5: Check whether MySQL is running

Run the following command in your terminal:

1
sudonetstat -tap | grepmysql

You should see the following line or something similar:

1
tcp        0      0 localhost:mysql         *:*                LISTEN      2810/mysqld

Step 6: Congratulations – You have just installed MySQL on Ubuntu. Share this fantastic news using one of the share buttons or leave a comment in the reply section below.

相關文章