MySQL installs note
Tuesday, March 03, 2009 by rain
Because I like to debug,optimize a system, used the executive efficiency of the program after a few options increase process designing when compiling installation so, I understand some likelihoods wrong, hope everybody points out. Mail:fLashc@21cn.com
? installs Mysql
# Tar Zxvf Mysql-4.0.14.tar.gz -C /setup
# Cd /setup/mysql-4.0.14
# Groupadd Mysql
# Useradd Mysql -g Mysql -M -s /bin/false
# . / Configure- - Prefix=/web/mysql \ appoints installation catalog
- - mode of Debug of Without-debug \ purify
- - With-extra-charsets=gb2312 \ adds Gb2312 Chinese character to support
- - the collection version that Enable-assembler \ uses function of a few character
- - Isam of Without-isam \ take out expressed type support to use Isam to express rarely now is a kind of watch that depends on platform
- - the watch that Innodb of Without-innodb \ take out expresses supportive Innodb is processing of general affairs of a kind of support, suit company level application
- - library of Pthread of With-pthread \ requisition (library of Posix line Cheng)
- - Enable-thread-safe-client \ compiles client end with line Cheng means
- - With-client-ldflags=-all-static \
- - With-mysqld-ldflags=-all-static \ compiles service end and client end with means of pure static state
# Make
# Make Install
# Scripts/mysql_install_db \ makes Mysql user database and watch file
# Cp Support-files/my-medium.cnf /etc/my.cnf \copy configures a file, have Large, medium, three environments issue Small, according to machine function choice, if negative charge is bigger, the memory that can revise a few variable inside uses a value
The Mysqld file that # Cp Support-files/mysql.server /etc/init.d/mysqld \copy starts
# Chmod 700 /etc/init.d/mysqld
# Cd /web
# Chmod 750 Mysql -R
# Chgrp Mysql Mysql -R
# Chown Mysql Mysql/var -R
# Cd /web/mysql/libexec
# Cp Mysqld Mysqld.old
# Strip Mysqld
# Chkconfig- - Add Mysqld
# Chkconfig- - Level 345 Mysqld On
# Service Mysqld Start
# Netstat -atln
Look have the port of 3306 to open, if Mysqld cannot be started, look / below Web/mysql/var make mistake log, it is the issue with catalog good without the setting attributive commonly
# Ln -s /web/mysql/bin/mysql /sbin/mysql
# Ln -s /web/mysql/bin/mysqladmin /sbin/mysqladmin
# Mysqladmin -uroot Password "youpassword" # installs the password of Root account
# Mysql -uroot -p
# inputs the password that you installMysql%26gt;use Mysql;Mysql%26gt;delete From User Where Password=%26quot;%26quot;; # is deleted use at this machine account of faceless connective empty passwordMysql%26gt;flush Privileges;Mysql%26gt;quit
The interface that ? installs DBI and DBD For Mysql to be used at offerring Perl to visit Mysql database is normative, affirm you had installed Perl please, general and acquiescent system mount
# Cd /setup
# Tar Zxvf DBD-mysql-2.9002.tar.gz -C /setup
# Tar Zxvf DBI-1.38.tar.gz -C /setup
# Cd DBI-1.38
# Perl Makefile.PL
# Make
# Make Test
# Make Install
The method because of the Perl in some Perl programs is / Usr/local/bin/perl, and acquiesce of red cap system is / Usr/bin/perl, had better make a connection so, assure compatibility
# Ln -s /usr/bin/perl /usr/local/bin/perl
# Cd. . / DBD-mysql-2.9002
Generate installation to configure a file to need to add a few parameter after Perl Makefile.PL, more troublesome, we can arrive through adding / the join of this program solves Web/mysql/bin/mysql_config problem
The system can search this command automatically to generate the database parameter that installs a need
# Ln -s /web/mysql/bin/mysql_config /sbin/mysql_config
# Perl Makefile.PL
# Make
I always run Make Test here the half makes mistake,But the test scenario that can run Mysql catalog to fall is after installation, the Mysql that does not know 3.x how)
You can run test scenario now, rate is very slow nevertheless, it is good to hang backstage
# Perl /web/mysql/sql-bench/run-all-tests- - User=root- - Password="youpassword "
Add:
A few useful option with ? common Mysql and commandMysqld-----Open log supports
- - Log
- - Log-update
- - Log-long-formart
? MysqlGrant All On Database. * To User Identified By "password" builds one User user, gift all attributive of its Database databaseThe droit that Revoke All On Database From User moves to go up in Database database except User user is restrictedMysql -uroot -p- - One-database Databasename%26lt;File.sql guides from File.sql file Sql statement arrives Databasename in this database
? MysqladminMysqladmin Flush-logs commands Mysqld opens a new log document afresh, it is file of clear sky old daily record, be equivalent to metempsychosis
? Mysqldump
- - Add-drop-table derives statement of Droptable If Exists is added when Sql statement
- - Quick derives quickly
- - Opt optimizes option (recommend)
? Myisamchk
The examination expresses option
- - Extend-check patulous examination
- - an examination option with Medium-check more eclectic career
Repair expresses option
- - Recover rehabilitate expresses a file
- - Safe-recover safe rehabilitate expresses a file, than- - Recover wants slow
Got-up rehabilitate is expressed
- - Force keeps clear of compulsively last temporarily file
- - the content that Quick makes a file according to element only has repair
The management of ? Mysql
The environment that can use Phpmyadmin(to need Php supports) support with Mysqlcc(linux graph interface, WINDOWS system supports)
...