Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 19/20 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 21st February 2012, 08:18 PM
settingsun Offline
Registered User
 
Join Date: Aug 2011
Posts: 150
windows_xp_2003firefox
What mysql user is put into mysql_connect() for a registration page?

I log into the mysql monitor as root, to practice using it. The registration page on my future website will need to connect to the mysql database to insert the information each customer gives it.

I started to write a php script that would use mysql_connect and a few other functions to give customers, who go to my future registration page, access to the database. I got a lot of errors.

I log into the monitor as root. That is not the user the registration page will be. What mysql user do I put into the mysql_connect() function - to give those who log onto the registration page of my site access to the mysql database, so they can insert their information?

Does this user go into /etc/my.cnf somewhere to let mysql know there is a user other than root?


Thank you
Reply With Quote
  #2  
Old 21st February 2012, 10:39 PM
Doug G Offline
Registered User
 
Join Date: Jul 2005
Posts: 640
windows_7firefox
Re: What mysql user is put into mysql_connect() for a registration page?

In the mysql server, add the desired user to mysql using phpmyadmin or some other mysql tool. Then grant the desired permissions for that user on the database your application will be using. Refer to the GRANT statement documenbtation in mysql to see the sql used.

Then in your code identify the mysql user account to use in your connection. Yes, typically such information is in a configuration file for the php application.
__________________
======
Doug G
======
Reply With Quote
  #3  
Old 22nd February 2012, 12:18 AM
settingsun Offline
Registered User
 
Join Date: Aug 2011
Posts: 150
windows_xp_2003firefox
Re: What mysql user is put into mysql_connect() for a registration page?

Thank you -

Quote:
Yes, typically such information is in a configuration file for the php application.
Could you explain this in more detail?

Last edited by settingsun; 22nd February 2012 at 12:57 AM.
Reply With Quote
  #4  
Old 22nd February 2012, 08:13 AM
Doug G Offline
Registered User
 
Join Date: Jul 2005
Posts: 640
linuxfirefox
Re: What mysql user is put into mysql_connect() for a registration page?

Quote:
Could you explain this in more detail?
Here's a snip of the file config.php used by the php application "cms made simple". There are other settings in the config.php file, but this may give you an idea

Code:
#-----------------
#Database Settings
#-----------------

#This is your database connection information.  Name of the server,
#username, password and a database with proper permissions should
#all be setup before CMS Made Simple is installed.
$config['dbms'] = 'mysql';
$config['db_hostname'] = 'localhost';
$config['db_username'] = 'mysqlusername';
$config['db_password'] = 'mysqlpassword';
$config['db_name'] = 'mydatabase';
#Change this param only if you know what you are doing
$config["db_port"] = '';


#If app needs to coexist with other tables in the same db,
#put a prefix here.  e.g. "cms_"
$config['db_prefix'] = 'cms_';
__________________
======
Doug G
======
Reply With Quote
  #5  
Old 22nd February 2012, 11:05 AM
settingsun Offline
Registered User
 
Join Date: Aug 2011
Posts: 150
windows_xp_2003firefox
Re: What mysql user is put into mysql_connect() for a registration page?

Thank you - You pointed me in the right direction to figure this out.
Reply With Quote
Reply

Tags
mysql, mysqlconnect, page, registration, user

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can not enter data to MySQL using PHP web page. yu xintian Using Fedora 1 25th December 2009 08:38 PM
MySQL, PHP and Apache = Help new user cannot connect, but root user can?? judobrian Using Fedora 3 24th February 2007 01:12 AM
Problems getting apache to serve user web page fastandsimple Servers & Networking 2 11th March 2006 10:22 PM
Blank PHP page after installing mysql 5.0 finrod Servers & Networking 1 18th December 2005 12:25 PM
mysql_connect problem Aquiles Servers & Networking 4 13th April 2005 11:32 PM


Current GMT-time: 15:55 (Friday, 01-08-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin Copyright 2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat