Saturday, 15 January 2011

mysql - Error bash: syntax error near unexpected toekn 'do' compiling tables -



mysql - Error bash: syntax error near unexpected toekn 'do' compiling tables -

currently using next guide create private server

http://arcemuwiki.blogspot.dk/2012/10/contents-how-to-compile-arcemu-with.html

i step in guide , when run:

for table in $(mysql -u root --password=mypass mydb -e "show tables;"); mysql -u root --password=mypass mydb -e "drop table $table;"; done;

i error:

error bash: syntax error near unexpected toekn 'do' compiling tables

i have not been able solve :/ help appreciated.

creating arc_logon, arc_characters , arc_world database construction homecoming arcemu code directory base of operations sql construction files located.

cd /home/arcemu/src/code/sql ubuntu@ubuntu:/home/arcemu/src/code/sql$ ls -l total 480 -rw-r--r-- 1 arcemu arcemu 2146 2011-05-12 22:03 2834_logon_structure.sql -rw-r--r-- 1 arcemu arcemu 36315 2011-05-12 22:03 3800_character_structure.sql -rw-r--r-- 1 arcemu arcemu 421549 2011-05-12 22:03 3955_world_structure.sql drwxr-xr-x 3 arcemu arcemu 4096 2011-05-12 22:03 character_updates drwxr-xr-x 3 arcemu arcemu 4096 2011-05-12 22:03 extra_scripts drwxr-xr-x 3 arcemu arcemu 4096 2011-05-12 22:03 logon_updates drwxr-xr-x 3 arcemu arcemu 4096 2011-05-12 22:03 misc drwxr-xr-x 4 arcemu arcemu 4096 2011-05-12 22:03 utilities drwxr-xr-x 3 arcemu arcemu 4096 2011-05-12 22:03 world_updates ubuntu@ubuntu:/home/arcemu/src/code/sql$

note in order drop of tables in database (clear db), utilize next cli command. warning! delete entire database!

for table in $(mysql -u root --password=mypass mydb -e "show tables;"); mysql -u root --password=mypass mydb -e "drop table $table;"; done;

alright nevermind, solved problem; however, getting sql error says: error 1049 (42000): uknown database 'mydb'

i think confusion lies in guide has me create 3 databases: arc_logon, arc_characters, , arc_world.

then has me files in sql folder , dont understand trying loop. had believed note , tried go next step.

the next step follows: add together users arc_logon before users can come in game, must have username , password. user privileges can specified (user, gm, etc). first, add together admin account; mysql -u root -p arc_logon type following.... insert accounts (login, password, gm, flags, banned) values ('your-login-name', 'your-password', 'az', '24', '0');

however, when seek to insert line, error there not table called accounts; therefore, assuming had create table using loop reason.

mysql bash

No comments:

Post a Comment