Mysql安装与启动的问题

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

  1. [client]
  2. #password = your_password
  3. port = @MYSQL_TCP_PORT@
  4. 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)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值