Re: Creating Mysql DB with PHP



> OK - that helps get a perspective. And yes, you are missing something: it
> has to do with the manner in which you are setting up your database.

AAAAhhhhhhhhh I can hear the pennies dropping :-)

>
> When you install a MySQL server, you initially install a user named
"root".
> That user initially has full privileges, including the ability to create
> other users. Generally, that account is used by the database
> administrator(s) to set up individual user accounts.
>
> When you create a MySQL database in CPanel, Cpanel is accessing the server
> with an existing user account that has the privileges to be able to create
> other users. That account was most likely set up by the system admin when
> you signed up for the hosting service. If you had that userID and
password,
> you could probably use it to access the database, as well as the user you
> created along with the database.
>
> The ultimate point being: you HAVE to have a userID and password already,
> even to create other userIDs. The only exception to this (that I'm aware
of,
> at least) is during the initial setup of MySQL, when you have to define
the
> 'root' user.
>
> The practical end of all this is that anyone who would be installing your
> program would already have a userID & password for MySQL.
>
> The biggest potential problem you face is that their userID would not have
> privileges to create a database, in which case the attempt to create the
> database would fail. You would have to provide some checking for that, and
> offer instructions on what to do in that case (which would be to create
the
> database manually).
>
> Another potential problem you face is that the database has already been
> created by the user before running your setup script. Again, you would
have
> to do some checking for that, and if the database exists, you would skip
the
> database creation process and move along to the table creation &
population.
> I would recommend a failsafe check confirming that the user really wants
to
> do this, however, on the odd chance that they may already have a database
> with the same name in use.
>
> Given what you are trying to accomplish, I would strongly recommend
getting
> a better grounding in MySQL. I don't know of any web tutorials online
other
> than the official stuff at the MySQL website, but I'm sure there are
> plenty - try www.w3schools.com for starters. Also, I have found the book
> "PHP 5 / MySQL Programming for the Absolute Beginner" to be a really good
> start - and since it includes instructions to install a MySQL server, it
> should help you learn your way around from the ground up.
>
> Hope that's some help -

The Pennies are in place now. I understand what i was missing and that
helps a lot, I am not sure what my next move will be on this process but
slotting those pennies in is a great help.

I just wanna thank you for your time and trouble on this matter, I am at the
start of my education and have a lot to learn, and you have helped greatly.

Thanks Tony
Alex


.



Relevant Pages

  • Re: Creating Mysql DB with PHP
    ... >> userID and password for that MySQL server. ... > I am only going by what I have to do when setting up a new database. ...
    (alt.php)
  • Re: New Installation cannot view users table
    ... this is a brand new install. ... Add/Remove software I removed mysql and reinstalled it. ... Seems like the mysql database is missing. ... Stop mysql (service mysqld stop) ...
    (Fedora)
  • Re: Getting started with Postgres or MySQL
    ... I would like to get this data into a Postgres or MySQL database. ... apt-get install mysql-server ... execute all queries within the SQL file. ...
    (Debian-User)
  • Re: How the hell do I run mysql and php in leopard????
    ... database I've got no clue what the hell I'm supposed to do. ... install mysql and then the following extras were needed for Leopard: ... Undo the first thing with chmod o-w php.ini ...
    (comp.sys.mac.system)
  • Re: connecting to a database
    ... I think, on your recommendation, ill just try mySQL. ... I had seen that page, however, this is really the first time I have ... You can install MySQL using the silent install option ... I have a Singleton class that acts as an interface to the database. ...
    (comp.lang.java.programmer)