Anda di halaman 1dari 3

MySQL 5.

0
Setup Notes
1. Changed variable of tmpdir in the /etc/my.cnf file. Uncommented to set the default temp
directory to fix an Error 13 bug when doing order by.
2. he suse systems location of mys!l command is /usr/bin
3. "et up the mys!ldata #text$ files in /usr/mys!ldata
%. he data for tables is &ept in /var/lib/mys!l
Maintenance
1. start the server manually by typing' cd /usr/bin nl
1
mysqld_safe
2. for mys!l administrator gui type in' cd /usr/bin nl mysqladministrator
!. to update simply login as root and run' cd /usr/mysqldata nl bas" update.s"
1. this will get all of the needed files and update the database accordingly
2. can be run in separate parts if one part fails' is normally ran in this order
1. bas" #etfiles.s"
2. $a%a &classpat" ./ 'ri%er
!. bas" updatedatabase.s"
(. he manual instructions to update a table are as follows
1. mysql u db p nl enter password of' tires
2. run the (ava file manipulation program' $a%a &classpat" ./ 'ri%er
!. load data infile )/usr/mysqldata/*+L,N-M,../.) replace into table .-0L, fields
terminated by )1)1
(. alter table .-0L, drop id1
5. set insert_id 2 11
3. alter table .-0L, add id int not null auto_increment4 add primary 5ey6id71
8. eventually when all wor&s well will be able to (ust run' cd /usr/mysqldata nl
bas" update.s"
5. add users by' create user N-M, identified by )9-SS:;<')1 nl #rant all on =.= to
N-M,
1. where all on *.* means all privileges to every database and table.
.ables
1. log into mys!l) mys!l *u U"E+,-.E *p nl enter user password
2. switch to the database' use '-.-0-S,1
1. if not sure type this in to get a list of databases' s"o> databases1
!. create a new table' create table .-0L, 6*+,L'1_N-M, '-.-.?9,4 *+,L'2_N-M,
'-.-.?9,71
(. to delete from a table' delete from .-0L, @A;N'+.+;NB1
1nl will be used to mean new line/ actual commands to type in are in bold.
:eb Ser%er Settin#s
1. put the mys!lconnector tool in the web server0s root macromedia folder
a. ACDA*usionM/8D>>>rootD:,0+N*Dlib or similar on machine
2. +estart coldfusion server.
!. 1pen the Coldfusion -dministrator add the database/ put in name and for driver choose ot"er
a. 234C U+5 6 $dbcCmysqlC//10.0.0.81C!!03/'-.-0-S,
b. 3river class 6 com.mysql.$dbc.'ri%er
c. User name 6 db
d. 7assword 6 tires
(. 8erify connection.
+M9;<.+NE '-.- FS+NE L;-' '-.- +N*+L,
,ote that engine .y9"-. will allow import to happen even if some fields are null in the source. ex'
1:;<;;;<;12
his might give an error for uploading to a 9nnodb table.
=or 9nnodb to get around this you can use something li&e
load data infle '/tmp/testdata.txt'
into table moo
felds terminated by ","
lines terminated by "\n"
(one, two, three, @vfour, fve)
!" four # nullif(@vfour,'')
$
-lso you can load data from a local computer by adding the local &ey word.
load data local infile >C'/txt=iles/order1ld.txt> replace into table ordering.orderitems fields terminated
by >;> lines terminated by >?r?n>
@ou can also set fields at the time of importing ex' where the table orderlimits contains another column
called dateCreated
load data local infile 'C:/txtFiles/header.txt'
replace into table ordering.orderlimits
fields terminated by '^' lines terminated by '\r\n'
(turnedIny! location! cost"f#oods$! dol%&ail! out'urch! o&er%llo(! order%llo()
set dateCreated * +o(()
Aollation ,rrorsC
use 49,-+@ in front of fields in a where to get past the error.
EA' 5E= 219, ordering.stoc&ing"aves st on 49,-+@ si.ipitem 6 49,-+@ st.item and 49,-+@
si.iploc 6 49,-+@ st.location
S"o> -ll .ables and 'atabasesC
select tableBschema/ tableBname/ engine/ tableBcollation
from informationBschema.tables
order by tableBname
.rouble Aonnectin#C
oo many failed connection attempts can loc& a host out. 9f a server can>t connect to the mys!l server/
use telnet mys!lserverip mys!lserverport on client computer.
connection refused means that nothing is running on that port
accepted means that something is running on that port
timeout means that a firewall is blocking access
if you get a message that the host is loc&ed out log into the mys!l server and run flus" "osts)

Anda mungkin juga menyukai