To install MySQL from the source code

Source: Internet
Author: User

MySQL is the Linux platform's most popular database system, today is the introduction of MySQL installation and simple operation Method!

Groupadd MySQL//set up MySQL user group
useradd-g mysql mysql//MySQL account set up
TAR-ZXVF mysql-x.x.xx.tar.gz//unzip MySQL
CD mysql-5.0.45//into the extracted MySQL directory
./configure–prefix=/usr/local/mysql–with-charset=utf8–with-collation=utf8_general_ci–with-extra-charsets= Latin1//Set parameters
Make
Make install//start installation
CP support-files/my-medium.cnf/etc/my.cnf//copy my-medium.cnf files to/etc/directory and rename to My.cnf

Open the my.cnf file with the editor, find the Log-bin=mysql-bin line, and comment it out

: #log-bin=mysql-bin

Cd/usr/local/mysql//Enter MySQL directory
bin/mysql_install_db--user=mysql
Chown-r Root. Set Directory Permissions Properties
Chown-r Mysql/usr/local/mysql/var
Chgrp-r MySQL
Bin/mysqld_safe--user=mysql &/Start MySQL

Open the/etc/rc.local file with the editor, plus/usr/local/mysql/bin/mysqld_safe–user=mysql & in front of exit 0

Reboot, enter MySQL, if you can enter the start success!

——————————-MySQL Common commands ————————

Mysql-uroot-p//Login native MySQL, root for user name
Mysqladmin-uroot-p password 1234//1234 for new password
Create DATABASE MyDB; Create a new database named MyDB
Drop DB mydb//delete a database named MyDB
Show databases//view database
DESC func//view detail structure of datasheet

————————— – Critical, common database maintenance operations ————

Mysqldump-uroot-p-all-database>/users/venmos/backup.sql//backup of all databases to backup.sql files in/users/venmos/directory
Mysqldump-uroot-p mydb>/users/venmos/backup.sql//Backup MyDB database to backup.sql file in/users/venmos/directory
Use/users/venmos/backup.sql//import of the Backup.sql database for the/users/venmos/directory

The above is about the installation of MySQL and simple operation method, hope for everyone useful!

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.