0

I'm experimenting with osCommerce, an e-commerce suite, for which I installed the LAMP stack using tasksel. It did ask for a "root password" for MySQL, but other that that I did not pay attention to the installation procedure. Now I'm faced with the following screen, with no idea with what goes where:

enter image description here

So my question is what are the default options, and how do I find all the details?

Oxwivi
  • 17,849
  • Maybe the default values are the same as here: http://library.linode.com/web-applications/e-commerce/oscommerce/ubuntu-9.10-karmic – Nicolas Raoul Nov 16 '12 at 10:28

3 Answers3

2

First, you should create a MySQL user for osCommerce to use. It's bad practise to use the root user/pass for a web application.

In a shell on the machine with the MySQL on it, do:

mysql -u root -p

Enter the root password you previously specified. This gets you a prompt which has full access to your mysql server.

Now, pick a database name - it doesn't matter what it is really so long as it's unique on the mysql server (to see existing ones: SHOW DATABASES;)

When you've decided on it:

CREATE DATABASE dbname;

For example, I'd probably just pick oscommerce.

Now you have to give a new user access to that database. Pick a username and password (the username can be oscommerce again, but make a secure password) - replace dbname here with what you chose a second ago:

GRANT ALL ON dbname.* TO username IDENTIFIED BY 'password';

Done. Now you have the details to put into your webform; the servername is just localhost or 127.0.0.1 (assuming the webserver is the same machine as the MySQL server), the user and password you just made, the database name is whatever you replaced dbname with. Port can be left empty.

Oxwivi
  • 17,849
Caesium
  • 15,807
1

Database server: 127.0.0.1 (if it is on the same computer, else the ip address of the remote host)

user name: ny MySQL user name. If you just set up mysql you should login to mysql on the local host and setup a user for your project (use the mysql commant in terminal). I do not suggest to use the database root user, however, this should work as well:

mysql -u root -p

follow these instructions:

adding users

Password: the password of the user specified before

Database Name: on your mysql database server there exists no database. So again, login into mysql, but this time with the user you just created. Then follow these instructions to generate a database. You then have to fill in the database name in your form:

Create Database

Database Server Port: leave empty should work. Keep the other settings as they are.

Michael K
  • 13,888
  • I assumed, that you have basic SQL knowledge. If not ask again as a comment! – Michael K Nov 21 '11 at 11:43
  • 1
    sorry Michael I basically duped your answer, but it took me ages to type so I'm leaving it if that's ok :p – Caesium Nov 21 '11 at 11:48
  • you are a slow-typer :-D pwned – Michael K Nov 21 '11 at 12:09
  • You should summarize the steps in your answers, like @Caesium did, instead of just linking to avoid issues with link rot. The links can be mentioned in the end as references. (Personally, I like to avoid traversing and reading through linked articles if the instructions are already there (unless I want to know the details), so I'll refer to Caesium's answers for the steps) – Oxwivi Nov 21 '11 at 12:20
  • unsure about this... the link is official mysql homepage, which ensures, that the information keep up to date on change. Further I want to encourage users, to read the background and find out how it works, instead of stupid copy and paste of commands. – Michael K Nov 21 '11 at 13:24
  • Official MySQL page is also an issue. Ubuntu generally sticks with the same version throughout the life of a release, it does not keep up-to-date with upstream except for security fixes. And nobody knows when a site (in general, not referring to MySQL.com) can go down - posting the steps here will keep the answer relevant. And well, I generally do read background info, but most people do not need to (that being the ease-of-use point of Ubuntu), they can set up osCommerce with just those commands. The references are there so they can check if they need to something more later. – Oxwivi Nov 21 '11 at 15:36
  • You can read the official SE stance on this: http://meta.stackexchange.com/q/8259 – Oxwivi Nov 21 '11 at 15:40
0

If you dont know the password, maybe it is just blank. If dont, to reset the root password you can follow this guide: MySQL Doc. Database server is localhost unless you have osCommerce and MySQL in different machines. For username you could use root, but if you use this in a production environment, using a more limited user will be better. Password is the password you choose during reset process. To create the database, you can login to mysql (remove -p switch if password is blank):

mysql -u root -p

And then use the following statement to show the databases in the system:

mysql > CREATE DATABASE the_name_you_want; 

Server port is 3306.

Salem
  • 19,744