Entry
Database: MySql: Operation: Check: Test: How to test your MySql server (locally)?
May 2nd, 2008 21:40
dman, Knud van Eeden, http://sturly.com
----------------------------------------------------------------------
--- Knud van Eeden --- 27 January 2021 - 03:11 pm --------------------
Database: MySql: Operation: Check: Test: How to test your MySql server
(locally)?
To possibly test a MySql server database system on your
own local computer.
===
The Mysql server system basically consists of 2 parts
1. -a database server program
that runs on a computer
(with an IP address or computer name),
and listening on a port (default 3306)
You start this software database server by running the program in
MySql bin directory mysqld-nt.exe and keeping this running or you
run it as a service
2. -a program to run SQL queries
(e.g. Mysql.exe in the bin directory,
or use your own program written in
BBCBASIC or other computer languages
which logs in and sends or receives SQL queries)
===
When you login, you minimally have to supply
enough information to contact that database server program
running on that computer, and listening on a certain
port.
You have to supply
1. -The IP address or computer name of that computer
2. -Your username (this is by default 'root', if you did not
change it in something else)
3. -Your password (this is blank, if you did not change it)
If you then are accepted by this database server software,
you are able to create or open databases,
create or use tables, and insert, delete, search, ... records
in this tables.
===
The installation is assumed to be a default installation.
===
Steps: Overview:
1. -Download (the latest) MySql server
http://dev.mysql.com/downloads/mysql/5.0.html
2. -Install the MySql server software on your local computer
3. -Start the MySql software server
1. -Goto the bin directory of MySql
2. -Run the command (all on one line)
start mysqld-nt.exe --defaults-file="<your MySql
directory>\my.ini" --basedir="<your MySql directory>" --datadir="<your
MySql directory>\data\" --standalone
1. -E.g. (all on one line)
start mysqld-nt.exe
--defaults-file="c:\program files\MySql\MySql server 5\my.ini"
--basedir="c:\program files\MySql\MySql server 5\"
--datadir="c:\program files\MySql\MySql server 5\data\"
--standalone
4. -Use the following (default) information to log in
host = <IP address or name of the computer on which MySql runs>
E.g.
host = localhost
or also
host = 127.0.0.1
username = <your username> (the default is root)
password = (the default is to leave this blank, so do not fill
in)
5. -The whole idea is that you have to tell exactly
where the MySql program running on that computer
can be found.
Usually you have to supply at least an IP address
like
127.0.0.1
or
localhost
when MySql runs on your own computer.
Otherwise when that computer is elsewhere on the
local network, or on the Internet, you
supply the IP address of that computer like
12.34.56.78
or computername like
CompanyComputer1
Sometimes you also have to supply the port
at which your MySql software is listening.
This is default port 3306.
But usually you do not have to fill this information
in.
6. -Now try your MySql SQL query
1. -E.g.
--- cut here: begin --------------------------------------------------
CREATE DATABASE IF NOT EXISTS yourdatabase1;
USE yourdatabase1;
CREATE TABLE IF NOT EXISTS yourtable1 ( nr INT, FirstName
VARCHAR( 50 ), LastName VARCHAR( 50 ) );
INSERT INTO yourtable1 ( nr, FirstName, LastName ) VALUES
( '1', 'Vanessa', 'Smith' );
INSERT INTO yourtable1 ( nr, FirstName, LastName ) VALUES
( '2', 'John', 'Doe' );
INSERT INTO yourtable1 ( nr, FirstName, LastName ) VALUES
( '3', 'Jane', 'Carson' );
SELECT * FROM yourtable1;
--- cut here: end ----------------------------------------------------
8. -If you run this SQL query (e.g. in mysql.exe, or by using a
(BBCBASIC) program you get output like the following
--- cut here: begin --------------------------------------------------
+----+-----------+----------+
| nr | FirstName | LastName |
+----+-----------+----------+
| 1 | Vanessa | Smith |
+----+-----------+----------+
| 2 | John | Doe |
+----+-----------+----------+
| 3 | Jane | Carson |
+----+-----------+----------+
--- cut here: end ----------------------------------------------------
===
Internet: see also:
---
Database: Relational: MySql: Link: Overview: Can you give an overview
of links?
http://www.faqts.com/knowledge_base/view.phtml/aid/35331/fid/52
---
BBCBASIC: Windows: CGI: Link: Can you give an overview of links?
http://www.faqts.com/knowledge_base/view.phtml/aid/43627/fid/768
----------------------------------------------------------------------