MySQL 8 – TecAdmin https://tecadmin.net How to guide for System Administrator's and Developers Thu, 17 Jun 2021 17:17:56 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.1 How to Install MySQL 8.0 on Ubuntu 20.04 https://tecadmin.net/install-mysql-8-on-ubuntu-20-04/ https://tecadmin.net/install-mysql-8-on-ubuntu-20-04/#respond Tue, 02 Feb 2021 07:24:20 +0000 https://tecadmin.net/?p=24471 MySQL is the popular relational database management system used for storing structured data in table formats. It is open source database server uses SQL (Structured Query Language) statements for to interact with. The MySQL is freely available under the terms of the GNU General Public License. This tutorial will help you to install MySQL 8 [...]

The post How to Install MySQL 8.0 on Ubuntu 20.04 appeared first on TecAdmin.

]]>
MySQL is the popular relational database management system used for storing structured data in table formats. It is open source database server uses SQL (Structured Query Language) statements for to interact with. The MySQL is freely available under the terms of the GNU General Public License.

This tutorial will help you to install MySQL 8 on Ubuntu 20.04 LTS Focal Linux systems.

Prerequisites

You must have a running Ubuntu 20.04 LTS system with sudo privileged account access. Next, login to your system and open a terminal.

ssh ubuntu@remote.host 

Run below commands to upgrade the current packages to the latest version.

sudo apt update && sudo apt upgrade 

Step 1 – Enable MySQL PPA

MySQL team provides official MySQL PPA for Ubuntu operating systems. You can download and install the package on your Ubuntu 18.04 system, which will add PPA file to your system. Run below command to enable PPA.

wget http://repo.mysql.com/mysql-apt-config_0.8.10-1_all.deb 
sudo dpkg -i mysql-apt-config_0.8.10-1_all.deb 

The installer will prompt you to set default repository for the MySQL version. Make sure the MySQL-8 is set in currently selected. You can change this by navigating to line and press enter.

mysql change apt configuration

Once the properly version is selected move curser to last row “Ok” using keyboard up/down keys. Press enter to continue process.

In case you select wrong version. Execute dpkg-reconfigure mysql-apt-config command after package installation to get this window again.

Step 2 – Installing MySQL 8 on Ubuntu

Your system is ready for the MySQL installation. Follow the below commands to install MySQL 8 on a Ubuntu 20.04 Linux system.

  1. Add GPG Key – Run the following commands to install MySQL on Ubuntu 18.04 system.
    sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 8C718D3B5072E1F5 
    
  2. Update cache – Execute below command to update apt cache on your system.
    sudo apt update  
    
  3. Install MySQL – finally install the MySQL server packages.
    sudo apt install mysql-server 
    

The installation process will prompt for the root password to set as default. Input a secure password and same to confirm password window. This will be MySQL root user password required to log in to MySQL server.

MySQL on Ubuntu 18.04

MySQL on Ubuntu 18.04

Step 3 – Secure MySQL Installation

Execute the below command on your system to make security changes on your Database server. This will prompt some questions. The do the high security provide all answers to yes.

sudo mysql_secure_installation 

Here you can enable/disable validate password plugin, Set required strength for passwords, remove anonymous users, disallow root login remotely, Remove test database and access to it and reload the reload privileges after applied changes.

See the below output and action taken by me:

Securing the MySQL server deployment.

Enter password for user root:

VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?

Press y|Y for Yes, any other key for No: y

There are three levels of password validation policy:

LOW    Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
Using existing password for root.

Estimated strength of the password: 50
Change the password for root ? ((Press y|Y for Yes, any other key for No) : y

New password: ****************

Re-enter new password: ****************

Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.


Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.

By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.


Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.

All done!

Step 4 – Connect to MySQL

The MySQL server has been installed on your system. Now connect to the MySQL database using the command line. Use root account password set in above step.

 mysql -u root -p 

Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.23 MySQL Community Server - GPL

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Conclusion

After completing this tutorial, You have installed MySQL 8 on Ubuntu 20.04 Linux system. Even you can access the MySQL from terminal, you can also install phpMyAdmin to work with it.

The production users recommended to schedule database backup on a regular interval. This script will help you to schedule MySQL database backup and copy them to remote locations.

The post How to Install MySQL 8.0 on Ubuntu 20.04 appeared first on TecAdmin.

]]>
https://tecadmin.net/install-mysql-8-on-ubuntu-20-04/feed/ 0
How To Install MySQL 8.0 on Ubuntu 18.04 https://tecadmin.net/install-mysql-8-on-ubuntu-18-04/ https://tecadmin.net/install-mysql-8-on-ubuntu-18-04/#respond Tue, 01 Dec 2020 13:49:32 +0000 https://tecadmin.net/?p=19123 MySQL is the most popular relational database management system. As an assumption MySQL is used by every third website running over the internet. The MySQL official team provides the Debian packages for MySQL 8 to install on Ubuntu systems. This tutorial will help you to install MySQL server on Ubuntu 18.04 Bionic Beaver systems. Prerequisites [...]

The post How To Install MySQL 8.0 on Ubuntu 18.04 appeared first on TecAdmin.

]]>
MySQL is the most popular relational database management system. As an assumption MySQL is used by every third website running over the internet. The MySQL official team provides the Debian packages for MySQL 8 to install on Ubuntu systems.

This tutorial will help you to install MySQL server on Ubuntu 18.04 Bionic Beaver systems.

Prerequisites

Login to your Ubuntu 18.04 system using shell access. For remote systems connect with SSH. Windows users can use Putty or other alternatives applications for SSH connection.

ssh ubuntu@remote.host

Run below commands to upgrade the current packages to the latest version.

sudo apt update && sudo apt upgrade

Step 1 – Configure MySQL PPA

MySQL team provides official MySQL PPA for Ubuntu operating systems. You can download and install the package on your Ubuntu 18.04 system, which will add PPA file to your system. Run below command to enable PPA.

wget http://repo.mysql.com/mysql-apt-config_0.8.10-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.10-1_all.deb

During the installation of MySQL apt config package. Select the first line as showing in below screenshot and press enter. Here you can select MySQL version (8.0 or 5.7) to install on your system. After that Select, the last line with text Ok and press enter to complete this.

Install MySQL on Ubuntu 18.04

Step 2 – Install MySQL 8 on Ubuntu 18.04

Your system is ready for the MySQL installation. Run the following commands to install MySQL on Ubuntu 18.04 system.

sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 8C718D3B5072E1F5
sudo apt update 
sudo apt install mysql-server

The installation process will prompt for the root password to set as default. Input a secure password and same to confirm password window. This will be MySQL root user password required to log in to MySQL server.

MySQL on Ubuntu 18.04

MySQL on Ubuntu 18.04

Step 3 – Secure MySQL Installation

Execute the below command on your system to make security changes on your Database server. This will prompt some questions. The do the high security provide all answers to yes.

sudo mysql_secure_installation

Here you can enable/disable validate password plugin, Set required strength for passwords, remove anonymous users, disallow root login remotely, Remove test database and access to it and reload the reload privileges after applied changes.

See the below output and action taken by me:

Securing the MySQL server deployment.

Enter password for user root:

VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?

Press y|Y for Yes, any other key for No: y

There are three levels of password validation policy:

LOW    Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
Using existing password for root.

Estimated strength of the password: 50
Change the password for root ? ((Press y|Y for Yes, any other key for No) : y

New password:

Re-enter new password:

Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.


Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.

By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.


Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.

All done!

Step 4 – Connect to MySQL

The MySQL server has been installed on your system. Now connect to the MySQL database using the command line. Use root account password set in above step.

 mysql -u root -p

Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.17 MySQL Community Server - GPL

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Conclusion

This tutorial helped you to install MySQL 8 on Ubuntu 18.04 LTS Linux system.

The post How To Install MySQL 8.0 on Ubuntu 18.04 appeared first on TecAdmin.

]]>
https://tecadmin.net/install-mysql-8-on-ubuntu-18-04/feed/ 0
How to Install MySQL 8.0 on CentOS/RHEL 8 https://tecadmin.net/install-mysql-8-centos-8/ https://tecadmin.net/install-mysql-8-centos-8/#respond Fri, 07 Feb 2020 16:56:05 +0000 https://tecadmin.net/?p=20133 MySQL is an open-source, relational database management system. At present, it is being developed under the Oracle Corporation. The MySQL 8 is the latest version available for the installation and use of the production application. MySQL 8.0 has many improvements and 2x processing speed over the previous version. In this version, MySQL team includes document [...]

The post How to Install MySQL 8.0 on CentOS/RHEL 8 appeared first on TecAdmin.

]]>
MySQL is an open-source, relational database management system. At present, it is being developed under the Oracle Corporation. The MySQL 8 is the latest version available for the installation and use of the production application. MySQL 8.0 has many improvements and 2x processing speed over the previous version. In this version, MySQL team includes document store for developing both SQL and NoSQL document applications using a single database.

This tutorial will help you to install MySQL 8 on CentOS 8 and RHEL 8 systems.

Prerequisites

You must have shell access with sudo privileged account on CentOS 8 system.

Step 1 – Install MySQL

The MySQL 8 packages are available under the AppStrem repository under CentOS 8. Install the required packages using the following command. This will also install multiple dependent packages.

sudo dnf -y install @mysql

After completing the installation, enable the MySQL service to auto-start on the system start. Also start service manually for the first time.

sudo systemctl enable mysqld.service
sudo systemctl start mysqld.service

Then check the service current status using the following command:

sudo systemctl status mysqld.service
● mysqld.service - MySQL 8.0 database server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2020-02-25 04:43:13 UTC; 22s ago
 Main PID: 16666 (mysqld)
   Status: "Server is operational"
    Tasks: 39 (limit: 17963)
   Memory: 534.9M
   CGroup: /system.slice/mysqld.service
           └─16666 /usr/libexec/mysqld --basedir=/usr

Feb 25 04:43:04 tecadmin systemd[1]: Starting MySQL 8.0 database server...
Feb 25 04:43:04 tecadmin mysql-prepare-db-dir[16582]: Initializing MySQL database
Feb 25 04:43:13 tecadmin systemd[1]: Started MySQL 8.0 database server.

Step 2 – Secure MySQL Installation

The MySQL installation has been completed. Now you can connect the MySQL server without any password but we recommend to secure the MySQL installation. The MySQL packages provide mysql_secure_installation command to apply the security. Just run the below command on terminal:

sudo mysql_secure_installation

and follow the on-screen instructions. Below are the details which require user input.

  • Press y|Y for Yes, any other key for No: y
  • Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
  • New password: [ENTER STRONG PASSWORD HERE]
  • Re-enter new password: RE ENTER PASSWORD HERE
  • Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
  • Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
  • Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
  • Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
  • Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

Step 3 – Connect MySQL

You have finished the installation and secured the MySQL server. Now connect to MySQL server via console or install phpMyAdmin to use a graphical web interface.

mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.17 Source distribution

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Step 4 – Create Database and User

It’s not recommended to use ‘root’ users to connect databases from applications. So it is a good idea to create a separate user for your application database connection. Below are the commands to create a new MySQL database, then create a new MySQL user and assign privileges on the database.

You can change the database and user name as per your requirements. Also, use a strong password for the user.

mysql> CREATE DATABASE tecadmin;
Query OK, 1 row affected (0.01 sec)

mysql> CREATE USER 'tecadmin'@'localhost' IDENTIFIED BY 'your secure password here';
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL ON tecadmin.* to 'tecadmin'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

Now, connect to MySQL server using the newly created user and list available databases.

mysql -u tecadmin -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.17 Source distribution

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| tecadmin           |
+--------------------+
2 rows in set (0.01 sec)

mysql>

Conclusion

You have successfully installed and configured MySQL 8.0 on CentOS 8 system. Your server is ready for production use. You may also require to configure automated database backup script for the production system.

The post How to Install MySQL 8.0 on CentOS/RHEL 8 appeared first on TecAdmin.

]]>
https://tecadmin.net/install-mysql-8-centos-8/feed/ 0
How To Install MySQL on Debian 10 https://tecadmin.net/install-mysql-on-debian-10-buster/ https://tecadmin.net/install-mysql-on-debian-10-buster/#comments Tue, 23 Jul 2019 05:42:52 +0000 https://tecadmin.net/?p=18828 As today, Debian Buster is the latest release available for the Debian operating systems. Which is also known as Debian 10. The newer Debian release has MariaDB as default in their repositories. Now, this tutorial will help you to install MySQL 8 or MySQL 5.7 on Debian 10 (Buster) Linux systems. Step 1 – Prerequisites [...]

The post How To Install MySQL on Debian 10 appeared first on TecAdmin.

]]>
As today, Debian Buster is the latest release available for the Debian operating systems. Which is also known as Debian 10. The newer Debian release has MariaDB as default in their repositories. Now, this tutorial will help you to install MySQL 8 or MySQL 5.7 on Debian 10 (Buster) Linux systems.

Step 1 – Prerequisites

Login to your Debian 10 system using shell access. For remote systems connect with SSH. Windows users can use Putty or other alternatives applications for SSH connection.

ssh root@debian10

Run below commands to upgrade the current packages to the latest version.

sudo apt update 
sudo apt upgrade

Step 2 – Configure MySQL PPA

MySQL team provides official MySQL PPA for Debian Linux. You can download and install the package on your Debian system, which will add PPA file to your system. Run below command to enable PPA.

wget http://repo.mysql.com/mysql-apt-config_0.8.13-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb

During the installation of MySQL apt config package, It will prompt to select MySQL version to install. Select the MySQL 8.0 or 5.7 option to install on your system.

For this tutorial, we have selected MySQL 5.7 to install on my Debian system. Once you have selected a specific version and you need to change the configuration, use the following command.

sudo dpkg-reconfigure mysql-apt-config

Select a version of your choice and save.

Step 3 – Install MySQL on Debian 10

Your system is ready for the MySQL installation. Run the following commands to install MySQL on a Debian machine.

sudo apt update 
sudo apt install mysql-server

The installation process will prompt for the root password to set as default. Input a secure password and same to confirm password window. This will be MySQL root user password required to log in to MySQL server.

Install MySQL on Debian 10

The next window will ask to re-enter the same password.

MySQL 8 provides an extended password security option. This is optional but we recommend to go with this option.

Debian install MySQL

Let the installation complete.

Step 4 – Secure MySQL Installation

Execute the below command on your system to make security changes on your Database Server. This will prompt some questions. The do the high security provide all answers to yes.

First start the MysQL service if not started:

sudo systemctl restart mysql.service

Then run below command:

sudo mysql_secure_installation

Follow the on screen instruction’s

Securing the MySQL server deployment.

Enter password for user root:

VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?

Press y|Y for Yes, any other key for No: y

There are three levels of password validation policy:

LOW    Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2

[...]

Select a password validation policy to MEDIUM or STRONG. After that, the process will ask to change the password. You can select a more complex password. Follow the other options and complete the wizard.

Step 5 – Connect MySQL

The MySQL server has been installed on your system. Now connect to the MySQL database using the command line.

mysql -u root -p

Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.17 MySQL Community Server - GPL

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

The post How To Install MySQL on Debian 10 appeared first on TecAdmin.

]]>
https://tecadmin.net/install-mysql-on-debian-10-buster/feed/ 7
How To Install MySQL 8.0 on CentOS 7/6 https://tecadmin.net/install-mysql-8-on-centos/ https://tecadmin.net/install-mysql-8-on-centos/#comments Sun, 23 Jun 2019 04:40:20 +0000 https://tecadmin.net/?p=18785 MySQL 8 is the latest version available for the installation. MySQL is the most popular database server for Linux systems, it also supports a large number of platforms. This tutorial will help you to Install MySQL Server 8.0 Community Edition on CentOS/RHEL 7/6 LInux using the package manager. Step 1 – Setup Yum Repository First, [...]

The post How To Install MySQL 8.0 on CentOS 7/6 appeared first on TecAdmin.

]]>
MySQL 8 is the latest version available for the installation. MySQL is the most popular database server for Linux systems, it also supports a large number of platforms. This tutorial will help you to Install MySQL Server 8.0 Community Edition on CentOS/RHEL 7/6 LInux using the package manager.

Step 1 – Setup Yum Repository

First, you need to enable MySQL yum repository in your system provided by MySQL. Execute one of the below commands as per your operating system version.

### On CentOS/RHEL 7 system ###
rpm -Uvh https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm

### On CentOS/RHEL 6 system ###
rpm -Uvh https://repo.mysql.com/mysql80-community-release-el6-3.noarch.rpm

Step 2 – Install MySQL Community Server

The MySQL yum repository contains multiple repositories configuration for multiple MySQL versions. So first disable all repositories in mysql repo file.

sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/mysql-community.repo

Then execute one of the followings commands as per your operating system to install MySQL.

yum --enablerepo=mysql80-community install mysql-community-server  ## CentOS & RedHat 
dnf --enablerepo=mysql80-community install mysql-community-server  ## Fedora Systems 

Step 3 – Start MySQL Service

Start the MySQL server using the following command from the Linux terminal.

Using SysVinit

service mysqld start

Using Systemd

systemctl start mysqld.service

Step 4 – Find default root Password

With the installation of MySQL 8.0, a temporary password is created for the MySQL root user. You can find the temporary password generated in log files.

grep "A temporary password" /var/log/mysqld.log

Output:

[Note] [MY-010454] [Server] A temporary password is generated for root@localhost: VWa>Bo9xFUrs

Step 5 – MySQL Post Install Setup

After installing MySQL first time, execute mysql_secure_installation command to secure MySQL server. It will prompt for few question’s, we recommended to say yes ( y ) for each.

mysql_secure_installation
Enter password for user root:

The existing password for the user account root has expired. Please set a new password.

New password:
Re-enter new password:

Change the password for root ? ((Press y|Y for Yes, any other key for No) : n

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

Step 6 – Restart and Enable MySQL Service

The MySQL installation has been successfully completed. Now restart the service and set up autostart on system bootup.

### Using SysVinit
service mysqld restart
chkconfig mysqld on

### Using Systemd
systemctl restart mysqld.service
systemctl enable mysqld.service

Step 7 – Working with MySQL

Now connect mysql database server Linux shell using below command. It will prompt for the password for authentication. On successful login, you will get the MySQL command prompt, where we can execute SQL queries.

mysql -h localhost -u root -p

Install MySQL 8 on CentOS & Fedora

After login, You can use the following commands to create a new database, create a user and assign privileges to the user on the database. Change values as per your requirements.

### CREATE DATABASE
mysql> CREATE DATABASE mydb;

### CREATE USER ACCOUNT
mysql> CREATE USER 'dbuser'@'192.168.10.101' IDENTIFIED BY 'secret';

### GRANT PERMISSIONS ON DATABASE
mysql> GRANT ALL ON mydb.* TO 'dbuser'@'192.168.10.101';

###  RELOAD PRIVILEGES
mysql> FLUSH PRIVILEGES;

Congratulations! you have successfully installed MySQL server on your system. Use below quick links for basic MySQL tasks.

The post How To Install MySQL 8.0 on CentOS 7/6 appeared first on TecAdmin.

]]>
https://tecadmin.net/install-mysql-8-on-centos/feed/ 10
How To Install MySQL 8.0 on Fedora 34/33 https://tecadmin.net/install-mysql-8-on-fedora/ https://tecadmin.net/install-mysql-8-on-fedora/#comments Fri, 05 Oct 2018 08:30:49 +0000 https://tecadmin.net/?p=17150 MySQL is a relational database management system. MySQL 8 is the latest version available for installation on Linux systems. If you need to install MySQL 5.7, the official repository provides packages up to Fedora 31. The latest Fedora version are recommended to use MySQL 8.0. Use other article to install MySQL 5.7 on Fedora 31/30 [...]

The post How To Install MySQL 8.0 on Fedora 34/33 appeared first on TecAdmin.

]]>
MySQL is a relational database management system. MySQL 8 is the latest version available for installation on Linux systems.

If you need to install MySQL 5.7, the official repository provides packages up to Fedora 31. The latest Fedora version are recommended to use MySQL 8.0. Use other article to install MySQL 5.7 on Fedora 31/30 and earlier versions.

This tutorial will help you to install MySQL 8.0 on Fedora 34/33/32/31/30 Linux systems.

Step 1 – Prerequisites

Login to your Fedora system and open a terminal. Now upgrade the current packages to the latest version by running the following command.

sudo dnf update

Step 2 – Setup Yum Repository

The MySQL team officially provides yum repository for the installation of MySQL community server on a Fedora systems. Create a new yum repository file using the content below:

vim /etc/yum.repos.d/mysql-community.repo
File: /etc/yum.repos.d/mysql-community.repo
[mysql80-community]
name=MySQL 8.0 Community Server
baseurl=http://repo.mysql.com/yum/mysql-8.0-community/fc/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

Save file and close.

Step 3 – Install MySQL Server

Now, run the following command to install the mysql-community-server packages on your Fedora system. This will also install all other required dependencies on your system.

sudo dnf install mysql-community-server

sudo systemctl enable mysqld.service
sudo systemctl start mysqld.service

Now, follow the post-installation instructions.

Step 4 – MySQL Post Installation Setup

The MySQL community server has been installed on your system. The installer will also generate a random password and set for the root user. You can find the root user password in log files.

grep 'A temporary password is generated' /var/log/mysqld.log | tail -1

2018-10-16T11:49:31.216147Z 1 [Note] A temporary password is generated for root@localhost: ,yJrusM58kW7

Now run the following command to apply security on the MySQL server. Simply execute the below command and follow the security wizard.

sudo mysql_secure_installation

Follow the onscreen instructions. Change your root account password and Press Y for all other operations to apply improved security.

  • Change the password for root? – Press y and change root password
  • Remove anonymous users? Press y
  • Disallow root login remotely? Press y
  • Remove test database and access to it? (Press y
  • Reload privilege tables now? Press y

Step 5 – Connect MySQL Terminal

All done. You can now connect to the MySQL server using the command line. The following command will connect MySQL running on the localhost as the root user. This will prompt for the root account password. You can also install LAMP stack on Fedora and configure PHPMyAdmin on fedora to access databases graphically.

mysql -u root -p

installing mysql 8 Fedora

That’s it. You have successfully installed MySQL Server 8.0 on your Fedora Linux system.

The post How To Install MySQL 8.0 on Fedora 34/33 appeared first on TecAdmin.

]]>
https://tecadmin.net/install-mysql-8-on-fedora/feed/ 9