Connecting to the local db
Posted by: Serving the King (---.syracuse-01rh15-16rt.ny.dial-access.att.net)
Date: September 18, 2006 10:15PM

Ok, WAMP is installed without a hitch.

Transferred files and db tables without any problems.

Now when I try to connect to the site within the local I get an error message telling me that it can't connect to the db?

I've double checked the settings and everything is right as far as I can tell, but it still won't connect.

Ideas? Hints?

Options: ReplyQuote
Re: Connecting to the local db
Posted by: CyberSpatium (67.170.181.---)
Date: September 19, 2006 10:36AM

mysql comes with the default root user set with no password. to access a database using a php script use

mysql_connect('localhost', 'root', '');

Options: ReplyQuote
Re: Connecting to the local db
Posted by: Serving the King (---.syracuse-02rh15-16rt.ny.dial-access.att.net)
Date: September 19, 2006 07:13PM

Hi CyberSpatium.

Thanks for the info, but where do I put that script?

Options: ReplyQuote
Re: Connecting to the local db
Posted by: CyberSpatium (67.170.181.---)
Date: September 20, 2006 09:36AM

you use the code above in your php script to connect to mysql

Options: ReplyQuote
Re: Connecting to the local db
Posted by: Serving the King (12.75.111.---)
Date: September 21, 2006 01:17PM

Okay, I tried that and it didn't do anything. I'm still getting the "Can not connect to database" error message.

Options: ReplyQuote
Re: Connecting to the local db
Posted by: CyberSpatium (67.170.181.---)
Date: September 21, 2006 06:14PM

are you getting this message in your script, or when you try to start phpmyadmin?

Options: ReplyQuote
Re: Connecting to the local db
Posted by: Serving the King (---.syracuse-02rh15-16rt.ny.dial-access.att.net)
Date: September 26, 2006 03:50AM

Let me explain what happens. That might help clear things up.

When I click on the WAMP icon in the System Tray and then click on the "Localhost" link, which is, from my understanding, supposed to open my site files on my local computer, I get the message:

phpBB : Critical Error

Could not connect to the database


I've tried changing the config.php files, the MySQL permissions, and a few other things that I thought would work, but it still gives me the same message.

STK

Options: ReplyQuote
Re: Connecting to the local db
Posted by: CyberSpatium (67.170.181.---)
Date: September 26, 2006 02:50PM

make sure you start mysql or you will not be able to connect to your database?

Options: ReplyQuote
Re: Connecting to the local db
Posted by: Serving the King (---.syracuse-01rh15-16rt.ny.dial-access.att.net)
Date: September 27, 2006 02:25AM

Yep, SQL is running. I start all services when I get ready to work on it. The problem is getting the php side to point to the database.

The config.php reads:
===================================================================
<?php


// phpBB 2.x auto-generated config file
// Do not change anything in this file!

$dbms = 'mysql';

$dbhost = 'localhost/cnvillage';
$dbname = 'cnvillage';
$dbuser = 'root';
$dbpasswd = '';

$table_prefix = 'phpbb_';

define('PHPBB_INSTALLED', true);

?>
===================================================================
It's the right dbname and host location, the db is there, but it's not connecting.

What am I doing wrong or missing?

STK

Options: ReplyQuote
Re: Connecting to the local db
Posted by: CyberSpatium (67.170.181.---)
Date: September 27, 2006 09:31AM

change:
$dbhost = 'localhost/cnvillage';

to:
$dbhost = 'localhost';

Options: ReplyQuote
Re: Connecting to the local db
Posted by: Serving the King (---.syracuse-02rh15-16rt.ny.dial-access.att.net)
Date: September 27, 2006 01:08PM

Okay, I made the change to 'localhost' (don't know why I didn't spot that before) and now I'm getting:

Parse error: parse error, unexpected T_STRING in C:\wamp\www\config.php on line 10

?

Options: ReplyQuote
Re: Connecting to the local db
Posted by: CyberSpatium (67.189.46.---)
Date: September 27, 2006 04:52PM

you are missing some kind of punctuation mark. make sure you have all your quotes, braces, semicolons , etc. correct.

Options: ReplyQuote
Re: Connecting to the local db
Posted by: Serving the King (---.syracuse-01rh15-16rt.ny.dial-access.att.net)
Date: September 28, 2006 01:09AM

Thanks CyberSpatium,

You have been more than patient with me. That fixed it other than some missing tables in my db, but that I can take care of.

God Bless!

STK

Options: ReplyQuote
Re: Connecting to the local db
Posted by: Serving the King (---.syracuse-01rh15-16rt.ny.dial-access.att.net)
Date: September 30, 2006 01:19PM

Ok, another probelm. sad smiley

I'm now getting this message:

phpBB : Critical Error

Could not get theme data for themes_id [8]


The data is there, both in the db and in the site files. A friend of mine asked how I download the db info, and suggested doing a live dump to the local computer. Great, I'd love to, but I don't know how to do that.

So...how do I do that?

Options: ReplyQuote
Re: Connecting to the local db
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: September 30, 2006 06:25PM

you can use phpmyadmin's export feature to dump your database or you can use the mysql console:
[dev.mysql.com]

if you are using phpmyadmin to export your database, dont forget to select the option to aslo export your data, or only your table sturcture will be exported, not all your data.

Options: ReplyQuote
Re: Connecting to the local db
Posted by: Serving the King (---.syracuse-03rh15rt.ny.dial-access.att.net)
Date: October 01, 2006 04:43AM

Yeah....exporting it from the server isn't a problem, that I've got down pat. The problem is getting the file to intergrate with the local db on my computer. I have the db saved (I do a nightly backup of all data) as .sql file(s), but the only way I can get them to load is to open it in MS WordPad and do a copy/paste to the SQL window and submit it that way.

What I want to do is just select the file and let it run, but the MySQL is limiting me to 2MG for the file size. The file is 31.2MG in size.

Is there a way to change the size allowed for the upload file? I've already checked the MySQL site and followed the directions there, but that didn't work.

STK

Options: ReplyQuote
Re: Connecting to the local db
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: October 03, 2006 02:19AM

in phpmyadmin click on the import tab, now use the file uploader to upload your file instead of copying and pasteing in the sql box

Options: ReplyQuote
Re: Connecting to the local db
Posted by: Serving the King (---.syracuse-03rh15rt.ny.dial-access.att.net)
Date: October 06, 2006 01:38AM

I figured out the problem with this, but I'm not sure how to fix it.

In the Import screen it's telling me the MAX file size to import with is 2.8 KB. Since my tables (with data included) comes to over 30 MB I have to break it down to smaller files using a cut/paste for this.

What I'd like to be able to do is change the Max file size to 45 MB since the site is growing and will be close to that sooner or later.

Do you have any ideas how to do this?

There's also another problem that I'm not sure if it's just something I'm going to have to put up with, or if it's another hitch in the system.

I'm using phpbb for an online forum, which WAMP seems to be working with fine. The only problem is when I need to go to the Admin area I get a message telling me I'm offline (which I am. I'm in an area where I have dial up at the only option for my online service.) and asking me if I want to conncect. When I click "No" the page goes back to the index. If I clieck "Yes" I get a message saying that I can't connect to the internet, would I like to work offline. The options are "Work offiline" and "Try again." I click "Work offline" and it takes me back to index page again.

BUT if I'm online it takes me to the live site Admin area, which not what I want.

So....????



Post Edited (10-06-06 01:45)

Options: ReplyQuote


Sorry, only registered users may post in this forum.