![]() You can use vi, vim or nano to edit the file. Lastly, you need to update the MySQL root password in the file /etc/mysql/my.cnf (as shown in Pic2) or you might not be able to add new database or user.If you disable incoming traffic for the mysql port, please remember to enable it again. Verify that you are able to connect to MySQL by running the command mysql again.Before the MySQL server shuts down, you will be prompted to key in the root password. Stop the MySQL server using the following command.At the MariaDB> prompt, run the following commands.UPDATE er SET Password=password('NEWSTRONGPASSWORD') WHERE User='root' Replace the NEWSTRONGPASSWORD with your chosen new strong password. At the MariaDB> prompt, change the root password by running the commands below.The ampersand (symbol &) at the end is required as it ensures that the command is being run parallel with the commands that follow afterwards. Since the command -skip-grant-tables enables anyone to connect without a password, it is considered highly insecure, hence, all commands that follow must be done within a brief period. Restart MySQL service in single-user mode and bypassing password authorization, by running the command below.You can also close the incoming traffic for MySQL port (default port is 3306 unless you changed it to something else) temporarily at the firewall if you want to be extra careful. If you can, log in to your server as a system user with root privileges and run these commands as su or sudo commands using those administrative privileges. Although you can login to your server as root user, it is highly recommended not to. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |