Install and configure MySQL on Linux

Source: Internet
Author: User

> Configure -- prefix =/myhome/MySQL -- Exec-Prefix =/myhome/MySQL -- With-charset = gb2312
> Make
> Make install
Edit/etc/My. CNF
[Mysqld]
Datadir =/myhome/MySQL/Data
Socket =/tmp/MySQL. Sock
# Default to using old password format for compatibility with MySQL 3.x
# Clients (those using the mysqlclient10 compatibility package ).
Old_passwords = 1

[Mysql. Server]
User = slview
Basedir =/myhome/MySQL

[Mysqld_safe]
Err-log =/myhome/MySQL/log/mysqld. Log
PID-file =/myhome/MySQL/run/mysqld. PID
Lower_case_table_names = 1
Socket =/tmp/MySQL. Sock

Log File
> Mkdir-P/myhome/MySQL/run/mysqld
> Mkdir-P/myhome/MySQL/Data
> Mkdir-P/myhome/MySQL/log
# Initializing a database
>/Myhome/MySQL/bin/mysql_install_db -- user = <username>

Start MySQL
Use slview account:
./Mysqld_safe -- defaults-file =/etc/My. CNF -- user = <username> &

Set the root password
/Myhome/MySQL/bin/mysqladmin-u Root Password 'root321'

Stop MySQL Service
./Mysqladmin-u root-P Shutdown

Remote logon maintenance:
./MySQL-H <ip>-u root-D dbnms-P

Common maintenance commands:
Show databases;
Show tables;
Use <Database Name>

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.