http://ftp.ntu.edu.tw/MySQL/Downloads/MySQL-6.0/mysql-6.0.11-alpha.tar.gz tar -xzvf mysql-6.0.11-alpha.tar.gz mv mysql-6.0.11-alpha mysql ======================mysql====================== 1.创建mysql所需的目录 mkdir -p mysql/{etc,database} 2.创建mysql用户组 useradd mysql 3.检查编译环境 echo $? 当为0的时候表示没有错误 ./configure \ --prefix=/data1/services/mysql \ --sysconfdir=/data1/services/mysql/etc \ --localstatedir=/data1/services/mysql/database \ --with-charset=utf8 http://blog.sina.com.cn/s/blog_476c7f7201017pw1.html configure: error: no acceptable C compiler found in $PATH details.你的机器里没有安装任何C语言编译器,可以安装gcc。 可以在安装盘里找到gcc相关的包进行安装,不过会比较繁琐,因为关联的包会比较多。 如果可以上网,使用yum安装是比较好的选择: yum install gcc yum -y install wget gcc gcc-c++ ncurses-devel cmake make perl 4.编译安装mysql make && make install make: *** No targets specified and no makefile found. Stop. http://blog.sina.com.cn/u/2439416855 http://blog.sina.com.cn/s/blog_91668c17010141vl.html 仔细查看 ./configure时,报了下边几个错 checking for tgetent in -lncurses... no checking for tgetent in -lcurses... no checking for tgetent in -ltermcap... no checking for tgetent in -ltinfo... no checking for termcap functions library... configure: error: No curses/termcap library found(重点错误) 看错误提示 可知是找不到curses,, 所以是缺少ncurses安装包 造成的 解决方法如下: 我的系统是RedHat5系列: yum list|grep ncurses yum -y install ncurses-devel 完成后,重新 ./configure --prefix=/data1/services/mysql --with-charset=gbk,make && make install 5.安装mysql test information_schema数据库 cd /data1/services/mysql
/data1/services/mysql/bin/mysql_secure_installation (
bin/mysql_install_db --user=mysql 这个貌似不能用
)
[root@iZm5ebmsq801ksw8y8x6kwZ mysql]# bin/mysql_install_db
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/data1/services/mysql/bin/mysqladmin -u root password 'new-password'
/data1/services/mysql/bin/mysqladmin -u root -h iZm5ebmsq801ksw8y8x6kwZ password 'new-password'
Alternatively you can run:
/data1/services/mysql/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /data1/services/mysql ; /data1/services/mysql/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /data1/services/mysql/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /data1/services/mysql/bin/mysqlbug script!
The latest information about MySQL is available at http://www.mysql.com/
Support MySQL by buying support/licenses from http://shop.mysql.com/
6.建立mysql配置文件 cd mysql目录 cp share/mysql/my-huge.cnf /etc/my.cnf cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld chown -R mysql:mysql database chown -R mysql:mysql lib ./bin/mysqld_safe & --user=mysql cd /data1/services/mysql ; /data1/services/mysql/bin/mysqld_safe & 7.增加mysql服务 chkconfig --add mysqld service mysqld restart [root@localhost mysql]# service mysqld restart Shutting down MySQL.161009 11:30:18 mysqld_safe mysqld from pid file /data1/services/mysql/database/localhost.localdomain.pid ended SUCCESS! Starting MySQL. SUCCESS! [1]+ Done bin/mysqld_safe chkconfig mysqld on 8.将mysql相关命令复制到/sbin目录 cp bin/* /sbin 9.使用mysqladmin创建mysql管理员及密码 mysqladmin -u root password 123456 /data1/services/mysql/bin/mysqladmin -u root password 'new-password' /data1/services/mysql/bin/mysqladmin -u root -h localhost.localdomain password 'new-password' http://blog.csdn.net/ixidof/article/details/5958904/ error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)' ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock rm -rf /var/lock/subsys/mysql http://zhangge.net/4225.html [root@localhost ~]# service mysqld start Starting MySQL. ERROR! Manager of pid-file quit without updating file.