Install MySQL In ubuntu (server, client, Dev), enable, stop, and restart, and Common Errors

Source: Internet
Author: User
Tags mssqlserver

1. installing server and client in Ubuntu is simple:

(1) install Server

Apt-Get install mysql-Server

During installation, you will be prompted to enter the password of the root account, as prompted.

Server is enabled by default after installation.

(2) install the client

Apt-Get install mysql-Client

 

2. Install the C language development interface for MySQL

Apt-Get install libmysqlclient15-dev

 

3. Enable, disable, and restart

1. Start

1. Start with service: Service mysqld start

2. Use the mysqld script to start:/etc/inint. d/mysqld start, or/etc/inint. d/MySQL start

3. Start with safe_mysqld: safe_mysqld &

Ii. Stop

1. Start with service: Service mysqld stop

2. Use the mysqld script to start:/etc/inint. d/mysqld stop, or/etc/inint. d/MySQL stop

3. mysqladmin Shutdown

3. Restart

1. Start with service: Service mysqld restart

2. Use the mysqld script to start:/etc/inint. d/mysqld restart, or/etc/inint. d/MySQL restart

 

The following four sentences are simple but practical! (Not tried)

Net stop MSSQLServer
Net start MSSQLServer

Net stop MySQL
Net start MySQL

 

It is also often used:

/Usr/sbin/mysqld restart (stop/start)

 

 

4. FAQs:

(1) error2002:

1) it is mainly because the server is not started;

2) or in/etc/MySQL/My. CNF file (or use locate my. comment out bind-address 127.0.0.1 (prohibit remote access, only allow local access) in CNF search for the file location );

3) then grant all privileges on * in MySQL *. * To 'myuser' @ '%' identified by 'mypassword' with grant option; flush privileges; the goal is to allow any machine on MySQL-server (%) connect to the serve using the username (myuser) and password (mypassword;

In mysq, enter:

Mysqll> use MySQL;

Mysql> select host, user from user;

The following results should be displayed:

+ ----------- + ------------------ +

| Host | user |

+ ----------- + ------------------ +

| % | Root |

| 127.0.0.1 | root |

| C2-1 | root |

| Localhost | Debian-sys-Maint |

| Localhost | root |

+ ----------- + ------------------ +

% Indicates that you have authorized remote access to any machine.

This basically solves the problem.

 

(2) Error 2003: It is basically related to the network. Check whether the route is correct!

 

For further questions, see: http://topic.csdn.net/u/20090920/22/14d4f597-b7d4-4c24-b0db-abb2956e66c3.html

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.