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