service mysql start * Starting MySQL database server mysqld No directory, logging in with HOME=

本文介绍了一种在Ubuntu 16环境下安装MySQL后遇到的启动错误,并提供了详细的解决步骤,包括停止MySQL服务、更改MySQL用户的家目录等操作。

在ubuntu 16的版本中,安装了mysql 后,启动时,程序提示  Starting MySQL database server mysqld    No directory, logging in with HOME=的错误。

解决办法:

  1. Stop MYSQL service:

    sudo service mysql stop

  2. Change home directory of mysql from nonexistent to original directory where it is supposed to be:

    sudo usermod -d /var/lib/mysql/ mysql

    3. Now start mysql server again with:

        sudo service mysql start


Beginning configuration step: Writing configuration file Saving my.ini configuration file... Saved my.ini configuration file. Ended configuration step: Writing configuration file Beginning configuration step: Updating Windows Firewall rules Adding a Windows Firewall rule for MySQL57 on port 3306. Attempting to add a Windows Firewall rule with command: netsh.exe advfirewall firewall add rule name="Port 3306" protocol=TCP localport=3306 dir=in action=allow 纭畾銆? Successfully added the Windows Firewall rule. Ended configuration step: Updating Windows Firewall rules Beginning configuration step: Adjusting Windows service Attempting to grant the required filesystem permissions to the 'NT AUTHORITY\NetworkService' account. Granted permissions to the data directory. Adding new service New service added Ended configuration step: Adjusting Windows service Beginning configuration step: Initializing database (may take a long time) Deleting the data directory from a previous (failed) configuration... Attempting to run MySQL Server with --initialize-insecure option... Starting process for MySQL Server 5.7.44... Starting process with command: F:\mysql\m\bin\mysqld.exe --defaults-file="F:\mysql\y\my.ini" --console --initialize-insecure=on --lower-case-table-names=1... TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). InnoDB: New log files created, LSN=45790 InnoDB: Creating foreign key constraint system tables. mysqld: File '.\姹熷鐪?slow.log' not found (Errcode: 2 - No such file or directory) Could not use 姹熷鐪?slow.log for logging (error 2 - No such file or directory). Turning logging off for the server process. To turn it on again: fix the cause, then either restart the query logging by using "SET GLOBAL SLOW_QUERY_LOG=ON" or restart the MySQL server. No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 42751b4d-8dec-11f0-b5f1-025034608cb2. Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher. A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher. CA certificate ca.pem is self signed. root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option. Process for mysqld, with ID 19428, was run successfully and exited with code 0. Successfully started process for MySQL Server 5.7.44. MySQL Server 5.7.44 intialized the database successfully. Ended configuration step: Initializing database (may take a long time) Beginning configuration step: Updating permissions for the data folder and related server files Attempting to update the permissions for the data folder and related server files... Inherited permissions have been converted to explicit permissions. Full control permissions granted to: NETWORK SERVICE. Full control permissions granted to: Administrators. Full control permissions granted to: CREATOR OWNER. Full control permissions granted to: SYSTEM. Access to the data directory is removed for the users group. Permissions for the data folder and related server files are updated correctly. Ended configuration step: Updating permissions for the data folder and related server files Beginning configuration step: Starting the server Attempting to start service MySQL57.................... 只有在任务处于完成状态(RanToCompletion、Faulted 或 Canceled)时才能释放它。 Ended configuration step: Starting the server . Found existing data directory, no need to initialize the database. Found existing data directory, no need to initialize the database.帮我解决
最新发布
09-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值