Skip to content

Instantly share code, notes, and snippets.

@m13m
Created February 4, 2018 23:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m13m/411454fc52fc1a23a88bf99a8f75f4c1 to your computer and use it in GitHub Desktop.
Save m13m/411454fc52fc1a23a88bf99a8f75f4c1 to your computer and use it in GitHub Desktop.

Installing MySQL Install MySQL by the following command (for Fedora, replace yum in the command with dnf):

shell> sudo yum install mysql-community-server This installs the package for MySQL server (mysql-community-server) and also packages for the components required to run the server, including packages for the client (mysql-community-client), the common error messages and character sets for client and server (mysql-community-common), and the shared client libraries (mysql-community-libs).

Starting the MySQL Server Start the MySQL server with the following command:

shell> sudo service mysqld start Starting mysqld:[ OK ] You can check the status of the MySQL server with the following command:

shell> sudo service mysqld status mysqld (pid 3066) is running. At the initial start up of the server, the following happens, given that the data directory of the server is empty:

The server is initialized.

SSL certificate and key files are generated in the data directory.

validate_password is installed and enabled.

A superuser account 'root'@'localhost is created. A password for the superuser is set and stored in the error log file. To reveal it, use the following command:

shell> sudo grep 'temporary password' /var/log/mysqld.log Change the root password as soon as possible by logging in with the generated, temporary password and set a custom password for the superuser account:

shell> mysql -uroot -p mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment