Learn how to create a database with cpanel.

In this tutorial we will be learning how to manage your database with cPanel. We will explain you how to create.

So once you enter the credentials like username and password you can simply press Log In. Once your credentials are authenticated you will be redirected to your cPanel dashboard. Now we will talk about database.

By clicking on MySQL Databases, we will create a new database. So for that you can keep a note of your database name that you have one to keep in account.

This will further help you, then you will be Login with your WordPress admin. So you need not to remember any thought of credentials later. This is a new database, has been added, so you can press go back.

Now you will create a MySQL user, so for the user you need to have a username. For example, we set the complete username will be: mysite12_my_home

Now you can set your password. Again the same password. You can see the strength of your password. Now you have an optional password generator, if you click this you see a system generated password.

If you want to use this you can directly use this, either case you can set advance options. Like if you want to set the password strength you can use alphacharacters or non-alphacharacters.

For example: if you only want to keep lowercase you can press this, if you only want to keep symbols you can press this. So if you want to use this password press generate password, and a password is generated.

And then simply use the password. If you want to use your own password, press cancel and click “Create User”. An user will be created successfully. Go back and we will show you the user and database.

This is the database that we created, you can rename and delete by clicking this. Similarly you can check the user that is created, you can manage its password that we just created, you can rename this and also delete it.

Now if you go back to your cPanel, in the File Manager, you can then set your folder permissions and privileges. Have your database hosted in this web hosting site.

Simply follow these steps in Android Studio to be able to get the database of your app:

  1. Go to Tools >Android >Device Monitor
  2. Find your application name in left panel
  3. Then click on File Explorer tab
  4. Select data folder
  5. Select data folder again and find your app or module name
  6. Click on your database name
  7. On right-top window, there is an icon button wherein when you hover your mouse cursor, it shows “Pull” (Arrow pointing left).
  8. Click it and save it on your PC
  9. Use FireFox Sqlite manager to attach it to your project.

Sadly, there is no plugin in Google Chrome.

I am not sure if this is a matter of one’s preference but I believe from my experience PDO provides more coding flexibility that MySQLi.

Here is an example so you will better understand what I mean.

Now, if that were to be MySQLi, I would be doing it like this:

Notice the difference? I had to call if conditions twice. If my query is very long, then my code would also be long.

Plus, there is also the issue of mysqli_escape_string(). With PDO, you do not have to call one since it calls that function automatically when you bind values to the parameters.

When I started using prepared statements in MySQL because of the SQL injection issue, this is the main reason why I opted to use PDO rather than MySQLi.

Related Posts Plugin for WordPress, Blogger...