MySQL Common operations

Source: Internet
Author: User
Tags mysql login
MySQL Setup password

MySQL does not have a password by default, so it is necessary to set a password
Mysqladmin-uroot password ' 123456 '
mysql-uroot-p123456

Change root password
/usr/local/mysql/bin/mysql -uroot更改环境变量PATH,增加mysql绝对路径密码重置vi /etc/my.cnf//增加skip-grant重启mysql服务 /etc/init.d/mysqld restartmysql -urootuse mysql;update user set password=password(‘111222‘) where user=‘root‘;第二个password表示一个函数(‘111222‘)就是新设置的密码,改完密码后再把skip-grant去掉
MySQL Login
1本地登录的方式式:mysql -uroot -p1112222用sockt登录:(只适合本机)mysql -uroot -p333333 -S/tmp/mysql.sock当本地有多个mysql时,可以使用socket去登录3远程登录的方式:(比如登录另外一台linux的mysql)mysql -uroot -h127.0.0.1 -P3306 -p111222  

MySQL Common operations

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.