|
There are many reasons that you might want to be able to interact with your MySQL database
directly:
Perhaps a script you want to use doesn't add the tables or data for you.
Maybe you have so many scripts already installed that you've lost track of the names of the
existing tables.
You might even need to manipulate parts of the data directly.
If this sounds like you, then phpMyAdmin will make the task much easier and there is now a
public version available courtesy of mattford.
If you would rather use this script on your own account, read on for (version 2.2.4)
installation instructions ...
Requirements
Before you start, you will need the following:-
- A CGI-BIN account
- A MySQL database
- A text editor
- An FTP program
- The latest version of the script (with .php extension, not .php3) from phpMyAdmin.Net
A script to create .htaccess and .htpasswd files would also be
advisable, although I do give a couple of alternative security measures near the end of this
tutorial.
Preparation
First of all you will need a MySQL database at Spaceports, so if you do not already have one,
log into the members' area using your CGI-BIN account details, and follow the link marked
'MySQL'.
If you don't have a CGI-BIN account yet, log into the members' area using your standard 'planet'
account details, and follow the link to apply for one.
Next you will need to download the latest version of the script from PHPWizard.Net - make sure you get a version where the files end in
.php rather than the .php3 extension. The archive filename usually
gives a clue as to which version it contains.
Unpack the files from the archive into a suitable directory on your own system and read the
files named README and Documentation.txt using Notepad (or similar)
before going any further.
Editing
Whilst still in Notepad, open the file called config.inc.php edit the details for
$cfgPmaAbsoluteUri like so:-
$cfgPmaAbsoluteUri = 'http://cgi-bin.spaceports.com/~username/yourdir/';
Replace username with your username (including the ~ character) and
yourdir with the name of the directory you plan to install the script in. Try not to
name it anything obvious, to make it harder for others to find.
Edit the details for $cfgServers[1] to the following:-
['host'] = 'localhost';
['port'] = '';
['socket'] = '';
['connect_type'] = 'socket';
['stduser'] = '';
['stdpass'] = '';
['auth_type'] = 'http';
['user'] = 'username';
['password'] = 'yourpass';
['only_db'] = 'username';
['verbose'] = '';
['bookmarkdb'] = '';
['bookmarktable'] = '';
Replacing username with your username and yourpass with your password.
Check the email from Spaceports if you are unsure.
Newer users have the same username and password as for their (CGI-BIN) FTP settings I believe.
Older users were sent a completely different password.
Do not forget to set 'only_db' to your username too, or the script will try to list all
databases on the server! This would be doubly pointless as you cannot access any database other
than your own, and listing them all would make the page load extremely slowly.
Save the file and close Notepad as you've finished editing.
Pruning
Now, you don't need to upload every file included in the distribution, and to do so would waste
space and use up more of your 1000 file limit than necessary. So, making sure you keep the
original archive, delete the following from the unpacked directories:-
- The
scripts directory inside the main directory
- The
CVS directory inside the main directory
- The
CVS directory inside images
- The
CVS directory inside lang
- The
CVS directory inside libraries
Next, check inside the lang directory. You will find a load of files named
using the format somelanguage.inc.php and some others ending in .sh
Delete all the files ending in .sh as they aren't needed. Delete all the
language files apart from English, plus one other language of your choice. This should leave
you with just two language files.
Moving
Create a new directory somewhere outside of the main directory, and move the following files
from the main directory into it:-
ANNOUNCE.txt
ChangeLog
CREDITS
Documentation.html
Documentation.txt
INSTALL
LICENSE
README
RELEASE-DATE-2.2.1
TODO
These are the documentation files, which you should keep safe in case you need to refer to them
later. There is little point in uploading them though.
You should now have something like half the number of files which now use about half the
space.
Uploading
You are now ready to upload, so start your FTP client and connect to your CGI-BIN account.
Create the directory you chose earlier, then upload the files in the same structure they are on
your system, creating any necessary subdirectories. Some FTP clients will create directories
automatically, some won't.
The directory structure should look something like this:-
Remember to upload the images in Binary mode, and all the other files in ASCII mode. CHMOD
all directories and files to 777 once they are all uploaded.
Testing
You should now be able to run the script by going to
http://cgi-bin.spaceports.com/~username/yourdir/
or
http://cgi-bin.spaceports.com/~username/yourdir/index.php
Important: Even if all went well, you still have work to do. You
must protect the directory using .htaccess and .htpasswd or risk
the chance that others will access the script!
Check this site for more information on using a script to set those files up for you.
The only other alternatives are:-
- CHMOD the directory to 700 after using the script and CHMOD it 777 before you start
- Delete
config.inc.php after using the script and upload it before you start
I think you'll agree that password protecting the directory is worth the extra initial
effort.
Good luck.
|