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:
- >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/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
# Initialize the 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>
For more information about how to install and configure mysql in linux, click http://database.51cto.com/col/484 /. Thank you for your support!