Ubuntu under MySQL installation (server, client, dev), open, stop and restart, and common errors

Source: Internet
Author: User
Tags mssqlserver

1. Installing the server and client under Ubuntu is simple:

(1) Installing the server

Apt-get Install Mysql-server

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

Server is turned on by default after installation

(2) Installing the client

Apt-get Install Mysql-client

2. Install the MySQL C language development interface

Apt-get Install Libmysqlclient15-dev

3. Turn on, off, restart

First, start

1. Start with service: Service mysqld start

2. Start with mysqld script:/etc/inint.d/mysqld start, or/etc/inint.d/mysql start

3. Use Safe_mysqld to start:safe_mysqld&

Second, stop

1. Start with service: Service mysqld stop

2. Start with mysqld script:/etc/inint.d/mysqld stop, or/etc/inint.d/mysql stop

3, mysqladmin shutdown

Third, restart

1. Start with service: Service mysqld restart

2. Start with mysqld script:/etc/inint.d/mysqld Restart, or/etc/inint.d/mysql restart

The following four sentences, although very simple, but very practical! (Not tried)

net stop MSSQLServer
NET start MSSQLServer

net stop MySQL
net start MySQL

Will often also use:

/usr/sbin/mysqld Restart (stop/start)

4. Frequently Asked Questions:

(a) ERROR2002:

1) mainly because the server does not start the cause;

2) Either comment out bind-address 127.0.0.1 in the/etc/mysql/my.cnf file (or search for the file location with locate MY.CNF) (disable remote access and allow only local access);

3) Then use the grant all privileges in MySQL on * * to ' myuser ' @ '% ' of ' identified by ' MyPassword ' with GRANT OPTION; FLUSH privileges; The purpose is to allow any machine (%) to be connected to the serve on the change mysql-server by the user name (myuser) and password (mypassword);

Again in the MYSQ, enter:

Mysqll>use MySQL;

Mysql>select host,user from user;

There should be a result similar to the following:

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

| Host | user |

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

| %        | Root |

| 127.0.0.1 | Root |

| c2-1 | Root |

| localhost | Debian-sys-maint |

| localhost | Root |

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

% indicates any machine that has been authorized for remote access.

This will basically solve the problem.

(b) ERROR 2003: Basically network-related, see if the route is right!

the beginner MySQL network friendly elephant often encounters the error that MySQL cannot connect. Special open stickers collect the phenomenon and cause of such problems.

throw a brick out of your own first.

===========================================================================================
Symptom : Unable to connect to MySQL
Err Message: Error 2003 (HY000): Can ' t connect to MySQL server on 'hostxxxxx' (10061)
Cause: The MYSQLD database service did not start.
check: In Windows Task Manager, or unix/linux under Ps-aux | grep mysql look at it. Confirm that the service is started.
processing: Starting the MYSQLD service
===========================================================================================

Ubuntu under MySQL installation (server, client, dev), open, stop and restart, and common errors

Related Article

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.