Ubuntumysql installation and user logon

Source: Internet
Author: User
Tumysql installation and user login to install MySQL, you can run the following command at a terminal prompt: sudoapt-getinstallmysql-servermysql-client # the middle will let you enter a root user password sudoapt-getinstallphp5-m... ubuntu mysql installation and user login to install MySQL, you can run the following command at a terminal prompt: sudo apt-get install mysql-server mysql-client # Midway will let you enter a root user password sudo apt-get install php5-mysql # installation php5-mysql is to connect php and mysql once installation is complete, the MySQL server should be started automatically. Www.2cto.com sudo start mysql # manually start sudo stop mysql # manually stop. after you modify the configuration file, you need to restart mysqld to make these changes take effect. To check whether the mysqld process is enabled, run the following command: pgrep mysqld. if the process is enabled, the command returns the id of the process. Ps-A | grep mysql if there are mysqld, mysqld_safe and other processes, it will be displayed, for example: 4460 pts/0 00:00:00 mysqld_safe 4583 pts/0 00:00:01 mysqld www.2cto.com login MYSQL problem: (1) After mysql-u root-p enters the password, the ERROR message is as follows: ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: YES), which means the root password is incorrect. The solution is as follows:. sudo mysqld_safe -- user = root -- skip-grant-tables -- skip-networking & after entering the command, the following message is displayed: [1] 5166root @ jungsagacity: /home/jung #120521 18:46:32 mysqld_safe Logging to syslog.120521 18:46:32 mysqld_safe Starting mysqld daemon with databases from/var/lib/mysql if the prompt message is: [2] 4928root @ jungsagacity: /home/jung #120521 18:44:40 mysqld_safe Logging to syslog.120521 18:44:40 mysqld_safe A mysqld proces S already exists indicates that the mysqld_safe process exists. you can use ps-A | grep mysql to view the process whose mysqld_safe process ID is kill-9-xxxx and whose end ID is xxxx. run the following command again: mysql-u root mysql indicates to log on to the mysql database as the root user, select * from user. details such as the registered user name and password are displayed. The root password is 123456. in fact, we enter mysql-u root-p enter password: 123456 ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: YES) modify the root password again: update user set PASSWORD = password ('20140901') where user = 'root' and host = 'localhost'; flush privileges; this statement is required, otherwise, you cannot log on to the mysql client. (2) a new user cannot log on to the mysql database as the root user. after logging on to mysql as the root user, you can create a local user named jun. after the client is released, log on to the database as jun, ERROR message ERROR 1045 (28000): Access denied for user 'wujun' @ 'localhost' (using password: YES):. when you create a user, enter the PASSWORD in the form of a string 'xxxxxx', instead of the correct statement www.2cto.com in the form of PASSWORD ('xxxxxx'): mysql> insert into user (host, user, password) values ('local', jun, PASSWORD ('xxxxxx'); mysql> flush privileges; B. after a correct insert statement is entered, mysql> flush privileges is not entered; author: jungsagacity

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.