Quick Test Setup of MySQL Cluster
To familiarize you with the basics, we will describe the simplest
possible configuration for a functional MySQL Cluster. After this,
you should be able to design your desired setup from the
information provided in the other relevant sections of this
chapter.
First, you need to create a configuration directory such as
/var/lib/mysql-cluster
, by executing the
following command as the system root
user:
shell> mkdir /var/lib/mysql-cluster
In this directory, create a file named
config.ini
that contains the following
information. Substitute appropriate values for
HostName
and DataDir
as
necessary for your system.
# file "config.ini" - showing minimal setup consisting of 1 data node,
# 1 management server, and 3 MySQL servers.
# The empty default sections are not required, and are shown only for
# the sake of completeness.
# Data nodes must provide a hostname but MySQL Servers are not required
# to do so.
# If you don't know the hostname for your machine, use localhost.
# The DataDir parameter also has a default value, but it is recommended to
# set it explicitly.
# Note: [db], [api], and [mgm] are aliases for [ndbd], [mysqld], and [ndb_mgmd],
# respectively. [db] is deprecated and should not be used in new installations.
[ndbd default]
NoOfReplicas= 1
[mysqld default]
[ndb_mgmd default]
[tcp default]
[ndb_mgmd]
HostName= myhost.example.com
[ndbd]
HostName= myhost.example.com
DataDir= /var/lib/mysql-cluster
[mysqld]
[mysqld]
[mysqld]
You can now start the ndb_mgmd
management
server. By default, it attempts to read the
config.ini
file in its current working
directory, so change location into the directory where the file is
located and then invoke ndb_mgmd
:
shell> cd /var/lib/mysql-cluster
shell> ndb_mgmd
Then start a single data node by running ndbd
:
Ïà¹ØÎĵµ£º
1¡¢Ñ¡È¡×îÊÊÓõÄ×Ö¶ÎÊôÐÔ
MySQL
¿ÉÒԺܺõÄÖ§³Ö´óÊý¾ÝÁ¿µÄ´æÈ¡£¬µ«ÊÇÒ»°ã˵À´£¬Êý¾Ý¿âÖеıíԽС£¬ÔÚËüÉÏÃæÖ´ÐеIJéѯҲ¾Í»áÔ½¿ì¡£Òò´Ë£¬ÔÚ´´½¨±íµÄʱºò£¬ÎªÁË»ñµÃ¸üºÃµÄÐÔÄÜ£¬ÎÒÃÇ¿ÉÒÔ½«
±íÖÐ×ֶεĿí¶ÈÉèµÃ¾¡¿ÉÄÜС¡£ÀýÈ磬ÔÚ¶¨ÒåÓÊÕþ±àÂëÕâ¸ö×Ö¶Îʱ£¬Èç¹û½«ÆäÉèÖÃΪCHAR(255),ÏÔÈ»¸øÊý¾Ý¿âÔö¼ÓÁ˲»±ØÒªµÄ¿Õ¼ä£¬É ......
±íÉè¼Æ·½Ã棺
1¡¢×Ö¶ÎÃû¾¡Á¿¼ò»¯£¬²»Òª³¬¹ý18¸ö×Ö·û
2¡¢Ê¹Óþ¡Á¿Ð¡µÄÊý¾ÝÀàÐÍ£¬ÀýÈ磺MEDIUMINT±ÈINTÉÙÕ¼ÓÃ25%¿Õ¼ä
3¡¢×Ö¶ÎÀàÐÍÓ¦¾¡Á¿±ÜÃâÉèÖóɿɱ䳤¶È£¬È磺VARCHAR¡¢BLOB¡¢TEXT
4¡¢ÓÃÓڱȽϵIJ»Í¬×ֶΣ¬Ó¦ÉèÖÃÏàͬµÄÀàÐͼ°³¤¶È
5¡¢¾¡¿ÉÄܽ«×Ö¶ÎÉùÃ÷ΪNOT NULL£¬²¢Ö¸¶¨DEFAULT
6¡¢Ö÷Ë÷Òý¾¡¿ÉÄܶÌ
7¡¢½ö´´½¨ÕæÕý ......
sudo apt-get install mysql-server mysql-client
sudo apt-get install sun-java6-jdk(°²×°³öÒâÍ⣬sudo dpkg -P sun-java6-bin£¬È»ºóÖØа²×°)
sudo vi /etc/network/interfaces ÅäÖÃÍøÂç
auto eth0
iface eth0 inet dhcp(static)
address 192.168.8.108
netmask 255.255.255.0
gateway 192.168.8.1
£ºx±£´æ
sud ......
<?php
$db_name="new";
mysql_connect("localhost","root","123456");
mysql_select_db($db_name);
$tb=mysql_list_tables($db_name);
$sql="";
while($query=mysql_fetch_row($tb)){
$sql="";$table_sql="";
$sql.= get_table_fn($query[0]);
get_table_row($que ......
PHPеÄÁ¬½ÓMySQL·½·¨mysqli
1. ¿ªÆôPHPµÄAPIÖ§³Ö
£¨1£©Ê×ÏÈÐÞ¸ÄÄúµÄphp.iniµÄÅäÖÃÎļþ¡£
²éÕÒÏÂÃæµÄÓï¾ä£º
;extension=php_mysqli.dll
½«ÆäÐÞ¸ÄΪ£º
extension=php_mysqli.dll
......