PDA

View Full Version : MySql setup.


Vanayad
20-10-2008, 15:05
Hey, so... I had some problems with my mysql and had to reinstall in on my pc (running it under windows).

I'm using a pack called Xampp containing Apache/MySQL/FileZilla/Mercury. The problem is that I can't make the mysql to run properly. It does run, but when I enter my forum it says there is a database error.

I presume this is because there isn't a path specified for the mysql server to my website... the thing is I tried to change most of the paths from "my.cnf" from E:/xampp/mysql/ to E:/site....but it doesn't work... I know I missed something but don't know exactly what...could anyone help please ?:)

Thanks.

Pete
20-10-2008, 15:25
Change the path back to mysql, you don't need to specify a path to a website in mysql, since mysql does not connect to the site, the site connects to it.

Is that all the error message says?

Are you able to create a script that can connect to a database or is it only the forum?

Does the mysql user for the forum have access to the forum's database?

Does the forum you're using support the version of mysql you have installed?

Vanayad
20-10-2008, 16:44
http://warhammerro.no-ip.org/forum/

this is the link with the error.

I'm using vBulletin and does support this version of mysql since I used the exact same version before I had to reinstall xampp.

MySQL user ? What do you mean by that ?

And I don't know how to create the script... I'm not that good in mysql... :(


EDIT: just noticed that when I go to the admin options in mysql there is a yellow light showing instead of green :/ ...though...the site didn't work when it was green either so that's not it :p

EDIT2: Back to green again o.O

Pete
20-10-2008, 17:03
mysql is probably not configured correctly.

Vanayad
20-10-2008, 17:05
yeah... that much I figured out :p Any ideas what I should do ?:P

Avoch
20-10-2008, 19:56
Join FA.WAR instead as our forum works :p

Vanayad
20-10-2008, 20:37
I'd gladly join, sadly I'm not playing WAR any more atm.. got a lot to do for school.

The forum is made for some friends where we can discuss meet-ups and when the next wargaming session will be :p so yeah.. I have to complete it :p

hinch
20-10-2008, 22:49
use WAMPServer instead of Xampp
http://www.wampserver.com/en/

Pete
21-10-2008, 02:16
Both wampserver and xampp are kinda ok, even though they both suck when it comes down to really managing a server, just like any other web server control panel software.

Anyways, I'd recommend uninstalling the whole package and reinstall it. If you don't want to do that, pm me and I'll try to help you get mysql configured correctly.

cRazy
21-10-2008, 02:50
loooooooooooooool

Pete
21-10-2008, 05:23
crazy, shut up.

Vanayad
21-10-2008, 06:38
ok, reinstalled it...but it still doesn't work :|

Pete
21-10-2008, 06:51
When reinstalling it, first, completely remove all files for mysql that were created by Xampp to make sure it doesn't use any configuration files that already exist. After doing that, you might have to recreate the forum db user, so the forum has a user account to connect to the forum database. You should be able to do that within the control panel under mysql. If you used the automated script from vbulletin it might be difficult for you to do on our own.

If nothing you do works, I can walk you through manually configuring mysql, if you want, and say please.

Vanayad
21-10-2008, 09:10
Thanks for the help so far, gonna continue this on PMs so not to bore the forum with my sql problems :P

pixel
21-10-2008, 11:05
Uh... why are you running all of this on Windows?!

hinch
21-10-2008, 11:50
easiest way to save old mysql configs is just copy the bin/data folder contents the base wamp config should work fine for everything really all you have to do is set a root mysql password but the rest should be fine

Vanayad
21-10-2008, 12:29
k...installed wamp and have the same problem ...

just that now I can get a forbidden error when I try to connect to my site :|

hinch
21-10-2008, 12:38
wtf have you done oO wamp should never give you that as its apache not IIS and so ignores windows file perms

Vanayad
21-10-2008, 12:50
the impossible :))

pixel
21-10-2008, 12:51
??

Easy guide to setting up WAMP: http://www.rasyid.net/2007/07/09/step-by-step-install-wamp-in-windows-xp/

Might save you a bit of time perhaps?

Vanayad
21-10-2008, 12:55
the installation process was easy >.>

Don't know why I had those errors though I just changed the path from /wamp/www/ to /site/ for the website in httpd.conf and the main page worked, but the other pages like /site/docs/ didn't, as they were "forbidden".

My biggest problem still remains that I don't know why doesn't the mysql server work :/ and how to make it work :(

pixel
21-10-2008, 13:14
im assuming you've set up a firewall rule to allow connections (port 3306) ?

Vanayad
21-10-2008, 13:30
I don't use a firewall ... and yes I did that in the windows firewall although it's deactivated:/

http://dev.mysql.com/doc/refman/5.0/en/can-not-connect-to-server.html

I looked up error 2003 (the one I have it seems) and although I did what they said there... I couldn't connect :/

pixel
21-10-2008, 13:40
Well... try going down a more diagnostic route?

Open up a command prompt (start -> run -> cmd) and type:

telnet localhost 3306

You should get:

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
@
5.0.51a-3ubuntu5.1?W{&Eje>,ï¿CvIJw;^F$|hv

Ignore this ^^ thats my operating system. The point is you should get a connection. If you do not get a connection check in task manager whether or not mysql is actually running.

Vanayad
21-10-2008, 13:46
well... I have in my taskmanager mysqld-nt running.

When I do what you said I get only this:

A
5.0.67-community-ntoJopf.0, :) and some other bable in the same lane (yes I do get a smiley face)

and then it says connection to host lost.

pixel
21-10-2008, 13:58
So your mysql server is sitting there, running, and accepting connections. So the problem will most likely be with the webserver not establishing the connection.

Do you have a mysql username and password set up? (In linux the default user is 'root' with a password you specify during installation but I've never done this under windows)

Create a blank PHP file and put into that file the following:

<?
$user = "username";
$pass = "password";
$host = "localhost";
$dbh=mysql_connect ($host,$user,$pass) or die ('I cannot connect to the database because: ' . mysql_error(). '');
?>

... and then save the file, and try to open it with your web browser (http://localhost/filename.php or whatever)

Vanayad
21-10-2008, 14:02
it's a blank page if I change username with root and password with the pass I chose :)

pixel
21-10-2008, 14:10
Then that means it's connecting successfully... :)

So there is no problem...

Vanayad
21-10-2008, 14:11
Ok.... then can you please tell me why I can't access:

http://warhammerro.no-ip.org/forum ?

uh oh... >.<

Question... may it be because the partition letter changed from F: to E: for the site hosted ?

Before the new windows installation it was f:/site/

and now it's e:/site/

:S

pixel
21-10-2008, 14:15
Well, what am I meant to be seeing?

Vanayad
21-10-2008, 14:21
Uhm... a basic vBulletin forum...

hinch
21-10-2008, 14:25
have you checked the apache log files see what errors its throwing up ?

have you checked the name of your db and the forum db username and password setup in mysql against the ones stored in the vbulletin config ?

pixel
21-10-2008, 14:26
Well, try this...

delete everything in said folder (vb on your webserver)

reinstall vb

create a database in mysql:
( create database databasename; )

grant all privileges on that database to a username identified by a password:
( grant all privileges on database.* to 'username'@'localhost' identified by 'password'; )

goto the administration/installation page for vb and then fill in the details providing the u/p/dbname you created above

hinch
21-10-2008, 14:34
you don't need to do that pixel you can edit the vb config file directly in includes/config.php

if he creates a db manually like that he needs to remember to flush privlidges; too else it won't load the new user into mysql :)

pixel
21-10-2008, 14:51
Never used VB before - so I'll shush :P

At least we know that the problem isn't with mysql now...

Vanayad
21-10-2008, 15:12
so I was playing with the mysql and the config file and noticed some errors...

for once the path to the site was incorrect in the config file (it was F:\ instead of E:\)

and ...the db "forum" with the table prefix "forum_" was missing :\

hinch
21-10-2008, 15:45
so did you fix them and does it work now?

pixel
21-10-2008, 15:49
URL still isn't working ^_^

Vanayad
21-10-2008, 16:01
yeah...

I fixed the user problem, the path problem... now I have to make the db o.O and that I don't really know how to do :(

pixel
21-10-2008, 16:06
You will probably have a .sql file or more than one .sql file... Not sure on the syntax in windows but in linux you'd do:

mysql -u USERNAME -p -D DATABASENAME < filename.sql

Vanayad
21-10-2008, 16:09
well, I use phpMyAdmin and I just press a button to create it ... but it's going to empty :/

pixel
21-10-2008, 16:14
phpMyAdmin should have an 'import' function to import a .sql file into a database?

Vanayad
21-10-2008, 16:16
yeah it does :)

I'm on the verge of a breakthrough... any minute now :)) lol

*goes back at tinkering*

pixel
21-10-2008, 16:25
Well good luck :P

hinch
21-10-2008, 16:27
only use phpmyadmin if your importing a backup.sql from an old db if your starting from scratch with vb then simply run its install script.

if your importing from a different forum type into vb then use the built in vb importers (impex)

Vanayad
21-10-2008, 16:44
ok... so ... I might have stumbled upon the reason why I can't seem to make this work :\

I have php 5.2.6 installed on the machine, the one that came with xampp, but I didn't do any configs for it... can that be the problem ?

I saw that vb has a file "mysql-scheme.php" ...and I bet I have to run that as a script... right ?

pixel
21-10-2008, 16:48
Shouldn't be a problem with PHP as you al ready tested that on post 26 (top of this page)...

Create another blank PHP page with the following in it:

<? php_info(); ?>

Save this and access it via your browser and see if it returns the PHP configuration information page

Pete
21-10-2008, 16:49
Have you tried reinstalling vbulletin after reinstalling mysql? If not, delete vbulletin completely(which I think someone already mentioned) and run the install script for vbbulletin. If mysql is working, then the install script should work fine. It'll create the database with the mysql user.

Vanayad
21-10-2008, 16:51
Fatal error: Call to undefined function php_info() in E:\site\test.php on line 1

guess that's not good.


I'd rather try not to delete VBulletin.......

Pete
21-10-2008, 16:53
it's phpinfo();

Do you see a vbulletin database under phpmyadmin or under mysql in your administrator control panel(didn't read everything so sorry if you already answered it)?

Vanayad
21-10-2008, 16:56
nope, there is none.

afaik I have to run mysql-schema.php for it to be created (located in the /install/ folder of vb.

but don't really know :S

edit: it works with phpinfo();

edit2: but when I try to run the script I get this:

MySQL Schema: $db is not an instance of the vB Database class. This script requires the escape_string() method from the vB Database class.

pixel
21-10-2008, 16:56
doh

and yes of course php is working correctly if you can even get to phpmyadmin

(end of a long day and my mind is now entangled in setting up vpn + proxy)

Pete
21-10-2008, 16:57
ok, run the install script, it should setup everything for you. I forgot which one it is, look on vbulletin website for the install instruction, or there is one within the vbulletin directory I think.

vbulletin is setup fine, it just needs to create the database and a mysql user for it.

Vanayad
21-10-2008, 17:06
It works... thanks I guess. I lost all the info I had on the site but it works at least!

THANKS A LOT TO ALL :D

pixel
21-10-2008, 17:08
you not got a database backup of your site beforehand?

Vanayad
21-10-2008, 17:11
kinda :(

didn't really know how to use db or how the site really works.... I backup up the forum folder -.- not the db folder....


...the shame :p

Pete
21-10-2008, 17:11
It works... thanks I guess. I lost all the info I had on the site but it works at least!

Unless you made a backup before you reinstalled mysql, it's gone no matter what.

Vanayad
21-10-2008, 17:14
Ok, np :p not that much was lost anyway :p

thanks again!

pixel
21-10-2008, 17:20
^_^

Vanayad
21-10-2008, 18:13
not wanting to create a new thread just for this...

how do I create an xml file ?

I have a directory with files (pictures from a forum skin) and I want to make a xml for it :)


EDIT: Nwm ...

Pete
21-10-2008, 19:08
Is it a skin template that you downloaded? Just place it in the directory for templates(haven't used vbulletin recently so can't remember where) and then you can select it in the admin panel.

Vanayad
21-10-2008, 19:16
it doesn't work :p

Pete
21-10-2008, 20:18
You might have to import it through the admin panel by selecting the location of the directory of the downloaded template. I don't know, I haven't created/messed with vbulletin templates in such a long time, I can't remember.

pixel
22-10-2008, 10:22
Never used VB so can't assist with that unfortunately... might be worth asking hinch?