当需要安装Mysql5.5.10时1.
1.3.
软件环境
Mysql5.5.10cmake2.8.32.
安装2.1.
安装cmakeshell>tar zxvf cmake-2.8.3.tar.gzshell>cd cmake-2.8.3shell>./configureshell>makeshell>make install2.2.
安装mysqlshell>tar zxvf mysql-5.5.10.tar.gzshell>cd mysql-5.5.10shell>cmake . \-DCMAKE_INSTALL_PREFIX:PATH=/usr/local/mysql \-DCOMMUNITY_BUILD:BOOL=ON \-DENABLED_PROFILING:BOOL=ON \-DENABLE_DEBUG_SYNC:BOOL=OFF \-DINSTALL_LAYOUT:STRING=STANDALONE \-DMYSQL_DATADIR:PATH=/usr/local/mysql/data \-DMYSQL_MAINTAINER_MODE:BOOL=OFF \-DWITH_EMBEDDED_SERVER:BOOL=ON \-DWITH_EXTRA_CHARSETS:STRING=all \-DWITH_SSL:STRING=bundled \-DWITH_UNIT_TESTS:BOOL=OFF \-DWITH_ZLIB:STRING=bundled \-DWITH_INNOBASE_STORAGE_ENGINE=1
\-DWITH_COMMENT=dancebear \-DDEFAULT_CHARSET=utf8 \-DDEFAULT_COLLATION=utf8_general_ci \-LHshell>make && make installshell>groupadd mysqlshell>useradd -g mysql mysqlshell>mkdir /usr/local/mysql/confshell>mkdir /usr/local/mysql/varshell>cd /usr/local/mysqlshell>cp support-files/my-huge.cnf conf/my.cnfshell>chown -R root:mysql /usr/local/mysql
shell>/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --skip-name-resolve --user=mysql --defaults-file=/usr/local/mysql/conf/my.cnf --pid-file=/usr/local/mysql/var/mysql.pid --socket=/usr/local/mysql/var/mysql.sock
shell>ln -s /usr/local/mysql/bin/mysql /usr/bin/mysqlshell>ln -s /usr/local/mysql/bin/mysqladmin /usr/bin/shell>ln -s /usr/local/mysql/bin/mysqld_safe /usr/bin/shell>ln -s /usr/local/mysql/share/mysql/mysql.server /usr/bin/shell>ln -s /usr/local/mysql/bin/mysqldump /usr/bin/3.
安装后配置3.1.
设置mysql自动启动脚本
shell>cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqldshell>chmod 755 /etc/init.d/mysqldshell>chkconfig –-add mysqldshell>chkconfig –-level 345 mysqld on
修改配置文件/etc/init.d/mysqld,添加安装mysql的路径
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
可以使用以下命令启停mysql服务或查看当前mysql服务状态shell>/etc/init.d/mysqld startshell>/etc/init.d/mysqld stopshell>/etc/init.d/mysqld status3.2.设置root密码
[root@ldap-mysql-svn-trac test]# mysqladmin -uroot password 'mysql'3.3.错误解决 110331 11:55:00 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
/usr/local/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
110331 11:55:00 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
110331 11:55:00 InnoDB: The InnoDB memory heap is disabled
110331 11:55:00 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
110331 11:55:00 InnoDB: Compressed tables use zlib 1.2.5
110331 11:55:00 InnoDB: Initializing buffer pool, size = 128.0M
110331 11:55:00 InnoDB: Completed initialization of buffer pool
110331 11:55:00 InnoDB: highest supported file format is Barracuda.
110331 11:55:00
InnoDB: Waiting for the background threads to start
110331 11:55:01 InnoDB: 1.1.5 started; log sequence number 1595675
110331 11:55:01 [ERROR] /usr/local/mysql/bin/mysqld: unknown option '--skip-locking'
110331 11:55:01 [ERROR] Aborting
110331 11:55:01
InnoDB: Starting shutdown...
110331 11:55:02
InnoDB: Shutdown completed; log sequence number 1595675
110331 11:55:02 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
【解决方案】:
[root@ldap-mysql-svn-trac mysql]# scripts/mysql_install_db --user=mysqlInstalling MySQL system tables...110331 13:21:15 [ERROR] ./bin/mysqld: unknown option '--skip-locking'110331 13:21:15 [ERROR] Aborting110331 13:21:15 [Note] ./bin/mysqld: Shutdown completeInstallation of system tables failed!
Examine the logs in./data for more information.You can try to start the mysqld daemon with:
shell> ./bin/mysqld --skip-grant &and use the command line tool ./bin/mysqlto connect to the mysql database and look at the grant tables:
shell> ./bin/mysql -u root mysql
mysql> show tablesTry 'mysqld --help' if you have problems with paths.
Using --loggives you a log in ./data that may be helpful.Please consult the MySQL manual section'Problems running mysql_install_db', and the manual section thatdescribes problems on your OS.
Another information source are theMySQL email archives available at http://lists.mysql.com/.Please check all of the above before mailing us!
And remember, ifyou do mail us, you MUST use the ./bin/mysqlbug script!然后,service mysqld start
[root@ldap-mysql-svn-trac mysql]# service mysqld start
Starting MySQL. [OK]
[root@ldap-mysql-svn-trac mysql]#[
本帖最后由 mysqldbd 于 2011-3-31 13:50 编辑 ]
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25267658/viewspace-691384/
,如需转载,请注明出处,否则将追究法律责任。