{"id":278,"date":"2023-02-26T13:27:50","date_gmt":"2023-02-26T13:27:50","guid":{"rendered":"https:\/\/blog.trustedhosting.in\/?p=278"},"modified":"2023-02-26T13:27:50","modified_gmt":"2023-02-26T13:27:50","slug":"my-sql-databases-cpanel","status":"publish","type":"post","link":"https:\/\/www.webystrata.com\/blog\/my-sql-databases-cpanel\/","title":{"rendered":"My SQL Databases &#8211; cPanel"},"content":{"rendered":"<p>MySQL is the most popular Open Source SQL Database management system. To manage a huge volume of data efficiently, we store the data in tables, a group of many tables can be created in a single database. This interface allows you to create and manage the existing MySQL databases.<\/p>\n<p>If you are creating a PHP based application or any application that uses a database, then you will need to create a database and a database user to access this database. To use WordPress, Drupal, Joomla or any other CMS, you will need to create a MySQL database before installing these CMS.<\/p>\n<p>To create a new MySQL database, you need to open MySQL interface by clicking MySQL Databases link, which can be found in the Databases section of cPanel Home.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/manage.trustedhosting.in\/index.php?rp=\/images\/kb\/50_mysqldb1.png\" alt=\"Databases\" width=\"1000\" height=\"461\" \/><\/p>\n<h2>Create a New Database<\/h2>\n<p>When MySQL Databases interface will open, first thing you will see is Create New Database Section as shown below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/manage.trustedhosting.in\/index.php?rp=\/images\/kb\/51_mysqldb2.png\" alt=\"MySQL Databases\" width=\"1000\" height=\"270\" \/><\/p>\n<p>To create a database, simply enter the name of the database you wish to create and then click Create Database Button. You will now get a success message that the database is added.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/manage.trustedhosting.in\/index.php?rp=\/images\/kb\/52_mysqldb3.png\" alt=\"MySQL Databases1\" width=\"1000\" height=\"348\" \/><\/p>\n<p><em><strong>Note<\/strong>\u00a0\u2212 cPanel will automatically add a prefix to your database name you enter. So that there is no ambiguity in databases as in shared hosting environment. There are many users and there cannot be same name for two databases, thus your database name become\u00a0<strong>Prefix_dbName<\/strong>. When connecting the database with web application you will need to use Full Name of database.<\/em><\/p>\n<h2>Add a Database User<\/h2>\n<p>To use your newly created database in your application, you will need to create a user and grant it all the privileges to modify the data in Database.<\/p>\n<p>To create a Database User, scroll down to the end in Interface of MySQL databases. There you will see MySQL users, under it there will be Add New User, as shown below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/manage.trustedhosting.in\/index.php?rp=\/images\/kb\/53_mysqldb4.png\" alt=\"Add New User\" width=\"1000\" height=\"379\" \/><\/p>\n<p><strong>Step 1<\/strong>\u00a0\u2212 Enter a username according to your choice and choose a strong password. Click Create User to create a new user. You will get a success message \u201cYou have successfully created a MySQL user.<\/p>\n<p><em><strong>Note<\/strong>\u00a0\u2212 Full username of your database user includes prefix and the username you provided.<\/em><\/p>\n<p>As we have created a database user, now we will need to add the user to access the database.<\/p>\n<p><strong>Step 2<\/strong>\u00a0\u2212 Scroll down to find \u201cAdd User to Database\u201d.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/manage.trustedhosting.in\/index.php?rp=\/images\/kb\/54_mysqldb5.png\" alt=\"Add User\" width=\"1000\" height=\"309\" \/><\/p>\n<p><strong>Step 3<\/strong>\u00a0\u2212 Select the User and database you wish to associate together. Click Add button and you will see the following screen.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/manage.trustedhosting.in\/index.php?rp=\/images\/kb\/55_mysqldb6.png\" alt=\"Manage User\" width=\"1000\" height=\"634\" \/><\/p>\n<p>To provide all the privileges to the user, select ALL PRIVILEGES checkbox and all the checkboxes will automatically get selected. Click\u00a0<strong>Make Changes<\/strong>\u00a0to save the changes.<\/p>\n<h2>Modifying a Database<\/h2>\n<p>The data stored in MySQL may get corrupted over time. There are many reasons for which this might happen. While using the Database in web application, if we see any database related error, we need to repair the database to repair the corrupt data. But before we repair our database, we will need to find the table on which our data is corrupted by checking the database for errors.<\/p>\n<p>There are two operations we can perform to troubleshoot database related errors. To perform these actions, we need to scroll to Modify Database Options in MySQL Database Interface, screenshot for Modifying Database is shown below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/manage.trustedhosting.in\/index.php?rp=\/images\/kb\/56_mysqldb7.png\" alt=\"Modify Database\" width=\"1000\" height=\"209\" \/><\/p>\n<h3>Check a Database<\/h3>\n<p>With this feature of cPanel Database, you can find which table in the Database is corrupted.<\/p>\n<p>To check a database, we need to perform the following steps.<\/p>\n<p><strong>Step 1<\/strong>\u00a0\u2212 Select the database you want to check, from the dropdown menu of Check Database, as shown above.<\/p>\n<p><strong>Step 2<\/strong>\u00a0\u2212 Click the Check Database button.<\/p>\n<p><strong>Step 3<\/strong>\u00a0\u2212 cPanel will now run an automated script to find the corrupt table in the Database. If any corrupt table is found, it will display the name of the Table, otherwise it will display a success message.<\/p>\n<h3>Repair a Database<\/h3>\n<p>This database tool helps in automatically repairing of corrupt data or table from the database.<\/p>\n<p>To use this tool, we need to perform the following steps \u2212<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/manage.trustedhosting.in\/index.php?rp=\/images\/kb\/57_mysqldb8.png\" alt=\"Repair Database\" width=\"1000\" height=\"132\" \/><\/p>\n<p><strong>Step 1<\/strong>\u00a0\u2212 Select the database having corrupt data from the dropdown menu.<\/p>\n<p><strong>Step 2<\/strong>\u00a0\u2212 Click Repair Database button.<\/p>\n<p><strong>Step 3<\/strong>\u00a0\u2212 cPanel will now run an automatic script to repair the corrupt data or table from the database, if it succeeds, it will give you a success message. If it fails to repair the database, it will show you an error with the table name on which the error occurred.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL is the most popular Open Source SQL Database management system. To manage a huge volume of data efficiently, we&hellip;<\/p>\n","protected":false},"author":1,"featured_media":279,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[12],"class_list":["post-278","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cpanel-complete-tutorials","tag-cpanel-complete-tutorials"],"_links":{"self":[{"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/posts\/278","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/comments?post=278"}],"version-history":[{"count":2,"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/posts\/278\/revisions"}],"predecessor-version":[{"id":281,"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/posts\/278\/revisions\/281"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/media\/279"}],"wp:attachment":[{"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/media?parent=278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/categories?post=278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/tags?post=278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}