mysql_install_db初始化后没有生成var目录,然后我指定目录初始化后发现能生成目录,但是启动时找不到文件,怎么回事?求大神解答

[root@LingShu mysql]# ./bin/mysql_install_db --user=mysql
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:
/document/mysql/bin/mysqladmin -u root password 'new-password'
/document/mysql/bin/mysqladmin -u root -h LingShu.cn password 'new-password'
Alternatively you can run:
/document/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 /document/mysql ; /document/mysql/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /document/mysql/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /document/mysql/bin/mysqlbug script!
[root@LingShu mysql]# ls
bin  docs  include  lib  libexec  mysql-test  share  sql-bench
[root@LingShu mysql]# ./bin/mysql_install_db --datadir=./var --user=mysql   #指定目录
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:
/document/mysql/bin/mysqladmin -u root password 'new-password'
/document/mysql/bin/mysqladmin -u root -h LingShu.cn password 'new-password'
Alternatively you can run:
/document/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 /document/mysql ; /document/mysql/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /document/mysql/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /document/mysql/bin/mysqlbug script!
[root@LingShu mysql]# ls
bin  docs  include  lib  libexec  mysql-test  share  sql-bench  var    #生成了var目录
[root@LingShu mysql]# ll
总用量 8
drwxr-xr-x  2 mysql mysql 4096 4月  21 22:33 bin
drwxr-xr-x  2 mysql mysql   41 4月  21 22:32 docs
drwxr-xr-x  3 mysql mysql   19 4月  21 22:32 include
drwxr-xr-x  3 mysql mysql   19 4月  21 22:32 lib
drwxr-xr-x  2 mysql mysql   40 4月  21 22:33 libexec
drwxr-xr-x 10 mysql mysql  218 4月  21 22:33 mysql-test
drwxr-xr-x  5 mysql mysql   45 4月  21 22:33 share
drwxr-xr-x  5 mysql mysql 4096 4月  21 22:33 sql-bench
drwx------  4 mysql root    31 4月  21 22:55 var
[root@LingShu mysql]# chown mysql:mysql var/     #更改属主属组
[root@LingShu mysql]# ll
总用量 8
drwxr-xr-x  2 mysql mysql 4096 4月  21 22:33 bin
drwxr-xr-x  2 mysql mysql   41 4月  21 22:32 docs
drwxr-xr-x  3 mysql mysql   19 4月  21 22:32 include
drwxr-xr-x  3 mysql mysql   19 4月  21 22:32 lib
drwxr-xr-x  2 mysql mysql   40 4月  21 22:33 libexec
drwxr-xr-x 10 mysql mysql  218 4月  21 22:33 mysql-test
drwxr-xr-x  5 mysql mysql   45 4月  21 22:33 share
drwxr-xr-x  5 mysql mysql 4096 4月  21 22:33 sql-bench
drwx------  4 mysql mysql   31 4月  21 22:55 var
[root@LingShu mysql]# ./bin/mysqld_safe --user=mysql&    #启动
[1] 66265
[root@LingShu mysql]# 180421 22:57:35 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
touch: 无法创建"/var/log/mariadb/mariadb.log": 没有那个文件或目录
chown: 无法访问"/var/log/mariadb/mariadb.log": 没有那个文件或目录
180421 22:57:36 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
./bin/mysqld_safe:行100: /var/log/mariadb/mariadb.log: 没有那个文件或目录
./bin/mysqld_safe:行137: /var/log/mariadb/mariadb.log: 没有那个文件或目录
180421 22:57:36 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
./bin/mysqld_safe:行100: /var/log/mariadb/mariadb.log: 没有那个文件或目录
[1]+  退出 1                ./bin/mysqld_safe --user=mysql
[root@LingShu mysql]#      
#启动失败,不知道是什么原因。那位大神遇到过???求解答
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值