Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After install, mySQL doesn' start (windows10, source install)

Tags:

mysql

I'm installing Apache server, php, and MySQL on Windows10. First two was successful but MySQL has a problem.

I installed MySQL into C:\mysql-5.7.10-winx64, and changed my.ini like this

basedir = C:/mysql-5.7.10-winx64
datadir = C:/mysql-5.7.10-winx64/data
port = 3306

I succeeded install but if I try to start, it shows like below

C:\Windows\system32>net start mysql
The MySQL service is starting.
The MySQL service could not be started.
The service did not report an error.
More help is available by typing NET HELPMSG 3534.

However, if I check Computer Management>Event Viewer>Custom Views>Summary page events, it tells me "failed to set datadir to C:\mysql-5.7.10-winx64\data\"

Error Event Description

If I make data folder manually, error message changed to

Can't open the mysql.plugin table

Please run mysql_upgrade to create it.." and some files are created in data folder

enter image description here

I tried to upgrade by typing mysql_upgrade but it failed.

mysql_upgrade: Got error: 2003: Can't connect to MySQL server on 'localhost' (10061) while connecting to the MySQL server. Upgrade process encountered error and will not continue.

How can I solve this issue?

like image 401
Changil Lee Avatar asked Dec 24 '15 06:12

Changil Lee


2 Answers

I had the same error, after checked this document: https://dev.mysql.com/doc/refman/8.0/en/data-directory-initialization.html

I just clear data directory and add the --console option to initialize:

bin\mysqld --defaults-file=C:\my.ini
   --initialize --console

Hope this help

like image 97
MocXi Avatar answered Oct 31 '22 13:10

MocXi


MySQL Server can either be run as a Program or as a Service. You cannot run both. You should stop 'mysqld' Server Program before starting 'mysqld' Server as Service.

The 'mysqld' Server Program can be stopped either by typing 'CTRL + c' or by issuing 'mysqladmin -u root -p shutdown' command and issue the password when prompted.

like image 26
senthil Avatar answered Oct 31 '22 15:10

senthil