{"id":4245,"date":"2022-07-19T08:00:54","date_gmt":"2022-07-19T15:00:54","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=4245"},"modified":"2022-07-19T08:00:56","modified_gmt":"2022-07-19T15:00:56","slug":"how-to-install-mysql-on-centos-9-stream","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=4245","title":{"rendered":"How To Install MySQL on CentOS 9 Stream"},"content":{"rendered":"\n<p>Hello, friends. In this post, you will learn how to install MySQL on CentOS 9 Stream.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.mysql.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">MySQL<\/a>&nbsp;is a powerful relational database manager owned by Oracle. It is open source but also has dedicated enterprise support, which makes it a great alternative to other paid solutions.<\/p>\n\n\n\n<p>Written in<a href=\"https:\/\/unixcop.com\/how-to-install-c-compiler-on-ubuntu-20-04-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">&nbsp;C and C++<\/a>&nbsp;it is capable of being very fast and handling many requests per second. This makes it suitable for projects of all types and sizes.<\/p>\n\n\n\n<p>In addition to this, MySQL becomes an important tool for many developers who have it for environment testing.<\/p>\n\n\n\n<p>Let\u2019s get to it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install MySQL on CentOS 9 Stream<\/h2>\n\n\n\n<p>As expected, MySQL is present in the CentOS 9 Stream repositories. So, the process becomes simple.<\/p>\n\n\n\n<p>First, open your terminal or connect via SSH and update the system<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf update<\/code><\/pre>\n\n\n\n<p>Then, you can install MySQL with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install mysql mysql-server<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/1118798822.rsc.cdn77.org\/wp-content\/uploads\/2022\/05\/1-21-1024x319.png\"><img decoding=\"async\" src=\"https:\/\/1118798822.rsc.cdn77.org\/wp-content\/uploads\/2022\/05\/1-21-1024x319.png\" alt=\"1.- Install MySQL on CentOS 9 Stream\" class=\"wp-image-19954\"\/><\/a><figcaption>1.- Install MySQL on CentOS 9 Stream<\/figcaption><\/figure>\n\n\n\n<p>Thereafter, check the installed version<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql --version\nmysql  Ver 8.0.28 for Linux on x86_64 (Source distribution)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Preparing MySQL for use<\/h2>\n\n\n\n<p>With MySQL installed, we need to do some configuration to get it up and running on the system. First, start the system service.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start mysqld<\/code><\/pre>\n\n\n\n<p>Then you can make it start with the system<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable mysqld<\/code><\/pre>\n\n\n\n<p>If you introduce changes to the MySQL configuration, then you have to restart it<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart mysqld<\/code><\/pre>\n\n\n\n<p>Finally, check the status of the service.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status mysqld\n\u25cf mysqld.service - MySQL 8.0 database server\n     Loaded: loaded (\/usr\/lib\/systemd\/system\/mysqld.service; disabled; vendor preset: disabled)\n     Active: active (running) since Sat 2022-05-21 15:25:43 UTC; 11s ago\n    Process: 2573 ExecStartPre=\/usr\/libexec\/mysql-check-socket (code=exited, status=0\/SUCCESS)\n    Process: 2595 ExecStartPre=\/usr\/libexec\/mysql-prepare-db-dir mysqld.service (code=exited, status=0\/SUCCESS)\n   Main PID: 2672 (mysqld)\n     Status: \"Server is operational\"\n      Tasks: 38 (limit: 12036)\n     Memory: 465.8M\n        CPU: 5.272s\n     CGroup: \/system.slice\/mysqld.service\n             \u2514\u25002672 \/usr\/libexec\/mysqld --basedir=\/usr\n\nMay 21 15:25:35 unixcop systemd&#91;1]: Starting MySQL 8.0 database server...\nMay 21 15:25:35 unixcop mysql-prepare-db-dir&#91;2595]: Initializing MySQL database\nMay 21 15:25:43 unixcop systemd&#91;1]: Started MySQL 8.0 database server.\n<\/code><\/pre>\n\n\n\n<p>Now we have to configure it, for this we will use the command&nbsp;<code>mysql_secure_installation<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysql_secure_installation<\/code><\/pre>\n\n\n\n<p>You will be prompted for a password, which must be blank. If you get an error when logging in, then you can show the temporary password with this command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo grep 'temporary password' \/var\/log\/mysqld.log<\/code><\/pre>\n\n\n\n<p>Once logged in, you can change the root password. You can also evaluate the strength of this password right there.<\/p>\n\n\n\n<p>You will then be asked the following questions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Remove anonymous users?\nDisallow root login remotely? \nRemove test database and access to it?\nReload privilege tables now?<\/code><\/pre>\n\n\n\n<p>To each of them, you will have to answer&nbsp;<code>Y<\/code>.<\/p>\n\n\n\n<p>And with this, you will be able to access the MySQL console<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysql -u root -p<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/1118798822.rsc.cdn77.org\/wp-content\/uploads\/2022\/05\/2-10.png\"><img decoding=\"async\" src=\"https:\/\/1118798822.rsc.cdn77.org\/wp-content\/uploads\/2022\/05\/2-10.png\" alt=\"2.- MySQL ready for work\" class=\"wp-image-19955\"\/><\/a><figcaption>2.- MySQL ready for work<\/figcaption><\/figure>\n\n\n\n<p>And we are ready to work.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The process of installing MySQL is something simple that we can do on our system without taking so much time. I hope you liked the process and the post as such.<\/p>\n\n\n\n<p>Ref: https:\/\/unixcop.com\/how-to-install-mysql-on-centos-9-stream\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello, friends. In this post, you will learn how to install MySQL on CentOS 9 Stream. MySQL&nbsp;is a powerful relational database manager owned by Oracle. It is open source but also has dedicated enterprise support, which makes it a great alternative to other paid solutions. Written in&nbsp;C and C++&nbsp;it is capable of being very fast <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=4245\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[262,5,178],"tags":[1240,1239],"class_list":["post-4245","post","type-post","status-publish","format-standard","hentry","category-centos","category-linux","category-wordpress","tag-install-mysql-on-centos-9","tag-install-mysql-on-centos-9-stream"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4245"}],"version-history":[{"count":1,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4245\/revisions"}],"predecessor-version":[{"id":4246,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4245\/revisions\/4246"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}