Simple scripts to import roles into mysql for later use with pwadmin
listrole.sh
PHP Code:
mysql -h127.0.0.1 -uroot -proot -e 'USE bd; TRUNCATE TABLE listrole;'
#Get City List
cd /server/gamedbd;
./gamedbd gamesys.conf listrole >listrole2.formatlog
cd /server/gamedbd
chmod 777 listrole2.formatlog
sed 's/['^a-zA-Z0-9,']//g' listrole2.formatlog > listrole3.formatlog
sed '1,17d' listrole3.formatlog > listrole.formatlog
mysqlimport -uroot -h127.0.0.1 -proot --force --columns=roleid,userid,name,race,occupation,gender,@x,@x,@x,@x,@x,@x,@x,level,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,reputation,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x,@x --fields-terminated-by=, DN /server/gamedbd/listrole.formatlog
rm listrole.formatlog
rm listrole2.formatlog
listrole.sql
PHP Code:
CREATE TABLE IF NOT EXISTS `listrole` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`roleid` int(10) unsigned NOT NULL,
`userid` int(10) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
`race` varchar(45) NOT NULL,
`occupation` varchar(45) NOT NULL,
`gender` varchar(45) NOT NULL,
`level` int(11) NOT NULL DEFAULT '0',
`reputation` int(11) NOT NULL DEFAULT '0',
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
Re: Simple scripts to import roles into mysql for later use with pwadmin
This is actually quite dangerous to do on a live db so think twice before using it.
Re: Simple scripts to import roles into mysql for later use with pwadmin
Hey its the old sed/mysqlimport system i came up with :D
You might wanna try listrolebreif btw. I mean i know you just copy and pasted my old script and changed parametres, but you should know you cant just go printing all that much data or it will simply corrupt/fail.
Re: Simple scripts to import roles into mysql for later use with pwadmin
Thanks bash for the info.
And rbb i dint know you made sed next time il use tr
PS its only normal to use sed as a possible solution
Re: Simple scripts to import roles into mysql for later use with pwadmin
Sure... , i guess its all just a huge coincidence and not at all copy and pasted.
(but you use @x like my scripts when it could be @zasdasdetrewnhkjfnsd and still work?)