1. sql默认安装路径查看:
./configure --help
prefix处可以看到默认安装路径。或者可以通过./configure --prefix=/usr/local/mysql设置
sql默认安装路径:A source distribution is installed after you configure and compile it. By default, the installation step installs files under/usr/local, in the following subdirectories:
Directory | Contents of Directory |
---|---|
bin | Client programs and scripts |
include/mysql | Include (header) files |
info | Documentation in Info format |
lib/mysql | Libraries |
libexec | The mysqld server |
share/mysql | Error message files |
sql-bench | Benchmarks and crash-me test |
var | Databases and log files |
2.mysql初始化数据库报错:
http://bbs.chinaunix.net/thread-3619332-1-1.html
[root@localhost mysql]# bin/mysql_install_db --user=mysql
Installing all prepared tables
Unknown suffix '@' used for variable 'port' (value '@MYSQL_TCP_PORT@')
111115 22:10:45 [ERROR] /usr/local/mysql/libexec/mysqld: Error while setting value '@MYSQL_TCP_PORT@' to 'port'
Installation of system tables failed!
解决:
查看my.cnf配置,发现port,socket都没有修改。重新拷贝my-medium.cnf到/etc/my.cnf
- [client]
- #password = your_password
- port = @MYSQL_TCP_PORT@
- socket = @MYSQL_UNIX_ADDR@
3. 解决Mysql不能启动的问题
http://flowerzheng.blog.163.com/blog/static/6938023020097135849758/
bin/mysql_install_db --user=mysql
报错:mysqld_safe Logging to '/usr/local/var/localhost.localdomain.err'
在 my.cnf 中增加了
[mysqld]
port = 3306
socket = /tmp/mysql.sock
添加下面一行
datadir = /var/lib/mysql/
和
[safe_mysqld]
err-log = /var/log/mysqld.log
pid-file = /var/lib/mysql/localhost.localdomain.pid
重新启动 mysql成功
/usr/local/mysql/var/db1.pid 这个文件名字貌似不能随便指定的
(我指定成了别的是不行的 ,这里的db1是你的hostname)