0

I'm very new to SQL and databases. I'm currently following this tutorial for creating a Magento website: https://www.tutorialspoint.com/magento/magento_installation.htm

and I'm on Step 4. It says to create a new database for my site (which I'm running on localhost/magento right now). I downloaded MySQLWorkbench for this, and when I click "Create new connection", I put localhost/magento into the "hostname" section.

I'm just not sure how I'm supposed to create a database for my specific website, and if it needs to be connected to the URL.

Hope somebody can help me out in simple terms :) Thanks.

closed as off-topic by mustaccio, John Eisbrener, LowlyDBA, Paul White says GoFundMonica Jul 2 at 8:30

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "This question does not appear to belong here. Either it's not database-related or it otherwise conflicts with the scope of our site. See What topics can I ask about here?, What types of questions should I avoid asking? or this blog post for more info." – mustaccio, Paul White says GoFundMonica
  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – John Eisbrener, LowlyDBA
If this question can be reworded to fit the rules in the help center, please edit the question.

1

A schema and a connection are two different things. So, creating a new connection does not mean to create a new schema/database.

You can create a database (or schema) in your server by using MySQL Workbench. After you opened a connection to your server, you will see the SQL IDE, a page with the treeview containing your current schemas, an SQL editor and various other stuff. In the schema tree use the context menu on any node to create the schema:

enter image description here

After that you can create a user with only the necessary rights for that single schema. Use the Administration -> Users and Privileges section for that:

enter image description here

Then assign the user access rights (e.g. for SELECT + DELETE) for that new schema by first allowing access to that new schema:

enter image description here

and finally set the required privileges:

enter image description here

Note: the backslash in the priv list is an escape sequence, because the string there is used as a pattern and the underscore ('_') is used as a placeholder in MySQL. Hence it must be escape to be used literally.

  • so when creating the new schema, it asks me for a connection. What exactly is that and how does it relate to my server and schema? I couldn't get past that step – user184434 Jul 1 at 7:57
  • Do you create the schema exactly like I have shown? I don't understand where this query for a connection comes from. You are already in a connection when you create the schema. – Mike Lischke Jul 1 at 11:19
  • "After you opened a connection to your server," <- I haven't done this before, so I'm a little confused about what I'm supposed to put here. It asks for hostname and port, but my website right now is just on localhost/magento – user184434 Jul 1 at 16:52
0

Nope, when you "create a database", think of it like you are creating a folder or a directory.

So, you'd create one with any name you want. Ex: my_fun_db or magneto_db, etc.

You will eventually then create a user who has access to THAT database.
Ex: magneto_user / passwordxyz

And you'd assign that user to have full access to your magneto database.

  • then what should I choose for the Connection and Hostname/port when creating a new database? I don't know what Connections mean and the hostname is defaulted to 127.0.0.1 – user184434 Jul 1 at 5:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.