The Path to executable field contains the -defaults-file setting.Īfter the server has started successfully, delete C:\mysql-init.txt. Find the MySQL service in the list, right-click it, and choose the Properties option. The appropriate -defaults-file setting can be found using the Services Manager: From the Start menu, select Control Panel, then Administrative Tools, then Services. defaults-file="C:\\Program Files\\MySQL\\MySQL Server 5.5\\my.ini" If you installed MySQL using the MySQL Installation Wizard, you may need to specify a -defaults-file option: C:\> "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld.exe" You can also add the -console option to the command if you want server output to appear in the console window rather than in a log file. The server executes the contents of the file named by the -init-file option at startup, changing each root account password. If you installed MySQL to a location other than C:\mysql, adjust the command accordingly. Start the MySQL server with the special -init-file option (notice that the backslash in the option value is doubled): C:\> C:\mysql\bin\mysqld -init-file=C:\\mysql-init.txt 322 What version of mySQL are you using I''m using 5.7.10 and had the same problem with logging on as root There is 2 issues - why can't I log in as root to start with, and why can I not use 'mysqldsafe to start mySQL to reset the root password. Open a console window to get to the command prompt: From the Start menu, select Run, then enter cmd as the command to be run. If you have MySQL version 5.7 or later that uses the authsocket plugin login as root by typing: sudo mysql Create a new MySQL User Account A user account in MySQL consists of two parts: user name and host name. For this example, the file will be named C:\mysql-init.txt. To access the MySQL shell type the following command and enter your MySQL root user password when prompted: mysql -u root -p. The UPDATE statement resets the password for all root accounts, and the FLUSH statement tells the server to reload the grant tables into memory so that it notices the password change. Write the UPDATE and FLUSH statements each on a single line. UPDATE er SET Password=PASSWORD('MyNewPass') WHERE User='root' Replace the password with the password that you want to use. If your server is not running as a service, you may need to useĬreate a text file containing the following statements. Running as a Windows service, go to the Services manager:įrom the Start menu, select Control Panel, thenĪdministrative Tools, then Services. Make sure you change the mysqld path to point to where you have installed MySql Server, for me it was "C:\Program Files\mysql\MySQL Server 5.6\bin\mysqld.exe": This helped me on Windows with MySQL Server 5.6.
0 Comments
Leave a Reply. |