Installation and configuration of mysql on Linux

Source: Internet
Author: User

Compared with other open-source databases,MysqlIt has better scalability. The main reason is that it provides open interfaces for the storage engine. Many programmers likeLinuxInstall mysql on the platform to develop your own programs. This article describes how to configure mysql and mysql in linux. First, let's introduce how to install mysql.

Installation:

 
 
  1. >configure --prefix=/myhome/mysql --exec-prefix=/myhome/mysql --with-charset=gb2312 
  2.  
  3. >make  
  4.  
  5. >make install 

Edit/etc/my. cnf:

 
 
  1. [mysqld]  
  2.  
  3. datadir=/myhome/mysql/data  
  4.  
  5. socket=/tmp/mysql.sock  
  6.  
  7. # Default to using old password format for compatibility with mysql 3.x  
  8.  
  9. # clients (those using the mysqlclient10 compatibility package).  
  10.  
  11. old_passwords=1 
  12.  
  13. [mysql.server]  
  14.  
  15. user=slview 
  16.  
  17. basedir=/myhome/mysql  
  18.  
  19. [mysqld_safe]  
  20.  
  21. err-log=/myhome/mysql/log/mysqld.log  
  22.  
  23. pid-file=/myhome/mysql/run/mysqld/mysqld.pid  
  24.  
  25. lower_case_table_names=1 
  26.  
  27. socket=/tmp/mysql.sock 

Log File:

 
 
  1. >mkdir -p /myhome/mysql/run/mysqld  
  2.  
  3. >mkdir -p /myhome/mysql/data  
  4.  
  5. >mkdir -p /myhome/mysql/log 

# Initialize the database:

 
 
  1. >/myhome/mysql/bin/mysql_install_db  --user=<username> 

Start mysql.

Use slview account:

 
 
  1. ./mysqld_safe --defaults-file=/etc/my.cnf --user=<username> & 

Set the root password:

 
 
  1. /myhome/mysql/bin/mysqladmin -u root password 'root321' 

Stop mysql service:

 
 
  1. ./mysqladmin -u root -p shutdown 

Remote logon maintenance:

 
 
  1. ./mysql -h <ip> -u root -D dbnms -p 

Common maintenance commands:

 
 
  1. Show databases;
  2.  
  3. Show tables;
  4.  
  5. Use <database Name>

For more information about how to install and configure mysql in linux, click http://database.51cto.com/col/484 /. Thank you for your support!

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.