Topic: Backing up a mySQL database?

Hello, all.

I've installed PunBB 1.1.5 onto my guild's site some time ago, and it's working fine. However, now I would like to upgrade to PunBB 1.2 so that I can have proper class management and private messanging, among other things.

I downloaded 1.2, and have the upgrade scripts, however, fear that something may go wrong, as usually, things do.

So, I would like to back up my mySQL database. The db is only like 500k altogether, but it'd be a shame to lose all those posts. smile

I have full access to the OS X box running the BB, command line and graphical. I looked around, googled my heart out, but could not find concrete intructions on how to back up mySQL.

This is all the default OS 10.3 Server stuff, and PunBB is installed into the default mySQL db (I know that's a bad idea, but I don't know how to admin mySQL.)

Thanks to all in advance!

-Tim

2

Re: Backing up a mySQL database?

1.2 final is not out yet, so what you downloaded was a beta. 1.2 final should be out shortly.

I use phpMyadmin to back up my databases: http://www.phpmyadmin.net/

Re: Backing up a mySQL database?

dont install it! It hasnt been released yet, hes still waiting on Paul.

To do anything to your database, get phpmyadmin. It can be hard to install, but it is a must. You will love it.

Just for now, try the following on your MySQL consule.

mysqldump -u [username] -p [password] [databasename] > [backupfile.sql]
#example
mysqldump -u gary -p 456123789 forums > forums_backup.sql

Please tell me if it doesnt work

Indocron
$theQuestion = (2*b) || !(2*b);

Re: Backing up a mySQL database?

Great, thanks.

Although I'm at the girlfriend's house right now, and can't test it, thanks for the help.

Also, I wasn't aware that PunBB 1.2 wasn't final - that's good to know, too. smile

Thanks.

-Tim

p.s. how shortly is shortly?

5

Re: Backing up a mySQL database?

yelowpunk wrote:

p.s. how shortly is shortly?

I heard it's coming out next year smile

Re: Backing up a mySQL database?

hahah... indeed....

I'm headed home right now, and I'll try that backing up thingy there... smile

-Tim

Re: Backing up a mySQL database?

It gives me an error.

This is what I'm typing at the mysql> prompt:

mysql> mysqldump -u root -p my_password mysql > mysqlbackup.sql

The default mySQL database is called, in fact, mysql, right?

-Tim

Re: Backing up a mySQL database?

Also, I've looked through the admin php page through PunBB, but I could not find the sql database being used. Maybe I'm looking in the wrong place?

:confused:

-Tim

Re: Backing up a mySQL database?

yelowpunk wrote:

It gives me an error.

This is what I'm typing at the mysql> prompt:

mysql> mysqldump -u root -p my_password mysql > mysqlbackup.sql

The default mySQL database is called, in fact, mysql, right?

-Tim

yes, but you can create new databases with phpmyadim wink It's soo easy..

Re: Backing up a mySQL database?

I've tried installing phpMyAdmin... it's hard as hell, to me...

It's like learning to drive in a country that has traffic signs in a different language with different icon schemes.


Care to teach me? wink

-Tim

Re: Backing up a mySQL database?

yelowpunk wrote:

I've tried installing phpMyAdmin... it's hard as hell, to me...

It's like learning to drive in a country that has traffic signs in a different language with different icon schemes.


Care to teach me? wink

-Tim

i know...i had some else install for me! tongue

Re: Backing up a mySQL database?

yelowpunk wrote:

I've tried installing phpMyAdmin... it's hard as hell, to me...

It's like learning to drive in a country that has traffic signs in a different language with different icon schemes.


Care to teach me? wink

-Tim

What OS & Privileges you have?

Re: Backing up a mySQL database?

I'm running OS X 10.3 Server, and it's my home server, so I have root priveledges (as well as hardware priviledges smile).

I can do pretty much anything to the box, up to and including installing and reinstalling software and hardware, and downtime comes at my sole discretion.

-Tim

Re: Backing up a mySQL database?

huh ... OS X wink)

did you check this and this?

Re: Backing up a mySQL database?

I have looked at those, but the boolean stuff to me is a different language. :shrug:

Half the time, I not only not know what to put in, but what they're ever asking me for. sad

-Tim

Re: Backing up a mySQL database?

sorry, no experience with mac, but I'll try to find some step by step guide for you

17

Re: Backing up a mySQL database?

If I'm not mistaken, OSX runs off of a unix back bone, so...

Best thing to do is put the phpmyadmin folder in your web folder, configure the config settings (password, host, mysql location), and just troubleshoot the rest. it "should" work...

Do, or do not.

Re: Backing up a mySQL database?

Right. OS X, in its root, it just a FreeBSD build on the Mach kernel.

Judging by your ava, snapsolutions, you should know your way around. tongue

I, however, don't. I can ssh in, and that's as far as I go. smile

-Tim

Re: Backing up a mySQL database?

Oh, and also:

I have tried to install it, and it won't lemme access the page.

The following is what it spits out upon going to http://timnetworks.com/admin/phpMyAdmin/

Welcome to phpMyAdmin 2.6.0-pl3

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server.
Error

MySQL said: Documentation
#1045 - Access denied for user: 'root@192.168.10.254' (Using password: NO)

-Tim

Re: Backing up a mySQL database?

yelowpunk wrote:

Right. OS X, in its root, it just a FreeBSD build on the Mach kernel.

I know, but I never worked on one so I don't wanna say something stupid when I am not sure smile

yelowpunk wrote:

Oh, and also:

I have tried to install it, and it won't lemme access the page.

The following is what it spits out upon going to http://timnetworks.com/admin/phpMyAdmin/

Welcome to phpMyAdmin 2.6.0-pl3

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server.
Error

MySQL said: Documentation
#1045 - Access denied for user: 'root@192.168.10.254' (Using password: NO)

-Tim

Now, it's easy. wink Search your config.inc.php file for these two lines

$cfg['Servers'][$i]['user']          = 'YOUR_USER_NAME';      // MySQL user
$cfg['Servers'][$i]['password']   = 'YOUR_PASSWORD';       // MySQL password (only needed with 'config' auth_type)

Enter your username and password

Re: Backing up a mySQL database?

I have. For username I put in root, for the password I put in the password that I use with 'sudo' when I ssh into the machine.

I think it's the fact that I'm logging in through the router (I'm connecting to the domain, and my server is the dmz) so the connection is seemingly coming form 192.168.10.254 (the linksys router) instead of my machine.

I just tried ip.address.of.server/admin/phpMyAdmin, and it gives me the same error. :shrug:

There is a line in the config;

$cfg['Servers'][$i]['AllowDeny']['rules']           // Host authentication rules, leave blank for defaults
                                     = array();

I believe this is the line that defines who can log into the phpMyAdmin, no? However, I'm not sure as to how to enter the information, much less the information that needs to be entered. If I put anything between the parenthesis, it gives me a parse error.

:shrug:

I can upload the config.inc.php file (of course, minus the passwords and stuff) if anyone wants to look at it. smile

Thanks with all the help so far, by the way. I really appreciate it!

-Tim