General > Helpful posts

MySQL n00b help.

(1/9) > >>

Glarawyn:
I may regret this at a later date, but here's a guide to help you get MySQL up and running on your Windows machine so you can run BeBot.

First, you'll need MySQL. Download the Windows Essentials package from MySQL.com. This is a MSI based installer. If it doesn't work for you, go to Microsoft Update to install the latest Windows Installer.

The installer is simple.

Phase 1: MySQL Installer
1. Click Next.
2. Select Typical, Click Next.
3. Click Install.
4. Select Skip Sign-Up, Click Next.
5. Check Configure MySQL Server Now, Click Finish.

Now you should be in the MySQL Server Instance Configuration Wizzard.

Phase 2: MySQL Server Instance Configuration Wizzard.
1. Click Next.
2. Select Detailed Configuration, Click Next.
3. Select Developer Machine, Click Next.
4. Select Multifunctional Database, Click Next.
5. Select C: and Installation Path, Click Next.
6. Select Decision Support, Click Next.
7. Check Enable TCP/IP Networking and Enable Strict Mode, Click Next.
8. Select Standard Character Set, Click Next.
9. Check Install As Windows Servers, Check Launch the MySQL Server automatically, Check Include Bin Directory in Windows PATH, Click Next.
10. Enter and confim your root password. Write down your root password and do not loose it!!! Do not check Enable root access from remote machines. Click Next.
11. Click Execute.
12. Click Finish. Reboot your computer.

At this point, you have MySQL installed and configured, but you haven't yet created a MySQL database.

Phase 3: Logging into MySQL
1. Open a command prompt. (Start > Run > CMD, Click OK)
2. In the command prompt, enter the command mysql -u root -p
3. Enter your root password (You did write it down so you wouldn't forget it right?)

You should now have a MySQL prompt that looks like: mysql>

Phase 4: Create a Database and Database User for BeBot
1. Type CREATE DATABASE databasename; (replace databasename with the name of the database you wish to create)
2. Press Enter/Return.
3. CREATE USER username@localhost; (Change username to the username you want, keep @localhost)
4. Press Enter/Return.
5. SET PASSWORD FOR username@localhost = PASSWORD('newpassword'); (Change username and newpassword to your selected username and password, again keep @localhost)
6. Press Enter/Return.
7. Type GRANT ALL on databasename.* TO username@localhost; (Again, change username, keep @localhost)
8. Press Enter/Return.
9. Type quit then Enter/Return to exit the MySQL Monitor.

Phase 5: Import items.sql to your database
IMPORTANT: This only applies for BeBot version older than 0.2.4
1. In the cmd.exe window, enter the command:
mysql -u username -p databasename < c:\bebot\items.sql
Change username and databasename to the names you selected in Phase 5. (You don't need @localhost)
2. Press Enter/Return.

Phase 6: Configure BeBot
1. Edit MySQL.conf, add the values you selected.
    $dbase = "databasename";
    $user = "username";
    $pass = "newpassword";
    $server = "localhost";
2. Edit Bot.conf following the instructions in INSTALL_GUILDBOT.txt or INSTALL_RAIDBOT.txt.
3. Run start.bat.

That's it, you're off and running.

Backing Up and Restoring your Database
It's reccomended that you backup your database. If the worst happens, you can easily recover. And the command to do so is simple:
mysqldump -u username -p --databases databasename --add-drop-table -a -f  > filename.sql

To restore a database dump:
mysql -u username -p databasename < filename.sql

Other Helpful Tools
MySQL Administrator GUI MySQL Admin Tool.
MySQL Query Browser GUI Query Tool.
MySQL Documentation The documentation, duh.

Dice:
Awsome guide. Good work, Glarawyn. :)

I just want to add that when you install MySQL on a old windows OS, like 98, MySQL cannot be run as a service, ie: the option to install it as a service is greyed out in the installer. In this case you need to run mysqld.exe from the ./bin directory manually or 'autostart' it.

...well, at least that's what I had to do. Me <- MySQL n00b too. ;D

Wolfbiter:
http://www.phpmyadmin.net/

It's a GUI for administrating mysql databases, and it's great.

Xenixa:
Prefer SQLyog myself. :)

http://www.webyog.com/sqlyog/index_sqlyogfree.php

blofeld:
Probably me being dumb somewhere but I followed all your steps up to rebooting the computer and using the password at the command prompt.

I can type in create database *name (name can be anything) but I can never actually create a database.  Doesn't matter what I do, I've checked the Mysql folder and nothing is showing up there.

After 4 reinstalls I'm ready to pitch this and live without a bot.

Hope you can help.

Navigation

[0] Message Index

[#] Next page

Go to full version