Jump to content

Search the Community

Showing results for tags 'sql'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Metin2 Dev
    • Announcements
  • Community
    • Member Representations
    • Off Topic
  • Miscellaneous
    • Metin2
    • Showcase
    • File Requests
    • Community Support - Questions & Answers
    • Paid Support / Searching / Recruiting
  • Metin2 Development
  • Metin2 Development
    • Basic Tutorials / Beginners
    • Guides & HowTo
    • Binaries
    • Programming & Development
    • Web Development & Scripts / Systems
    • Tools & Programs
    • Maps
    • Quests
    • 3D Models
    • 2D Graphics
    • Operating Systems
    • Miscellaneous
  • Private Servers
    • Private Servers
  • Uncategorized
    • Drafts
    • Trash
    • Archive
    • Temporary
    • Metin2 Download

Product Groups

  • Small Advertisement
  • Large Advertisement
  • Advertising

Categories

  • Third Party - Providers Directory

Categories

  • Overview
  • Pages
    • Overview
    • File Formats
    • Network
    • Extensions

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Pillory


Marketplace


Game Server


Country


Nationality


Github


Gitlab


Discord


Skype


Website

Found 23 results

  1. Hello, community! I would like to share a simple tutorial about how to make a permanent skill. For this, you will need to modify the following files: skill_proto (SQL) skilldesc.txt (client/locale) skilltable.txt (client/locale) uitooltip.py (client/root) skill_proto skilldesc.txt skilltable.txt uitooltip.py Αny improvements or corrections are welcome!
  2. In this topic I would like to teach you how to install MariaDB instead Oracle MySQL and why. Why prefer MariaDB instead MySQL? MariaDB it's a fork of MySQL and it is compatible with MySQL. Forecasts indicate that the MariaDB fork replace Oracle MySQL Server as rdbms. MariaDB have more features for performance and data integrity. One of this features is Aria storage engine. Aria is the upgrade of old MyISAM storage engine used on our Metin2 Private server. This old storage engine have some bugs and it isn't ACID like InnoDB. An upgrade of InnoDB is the fork XtraDB, used on MariaDB and Percona. So if you don't want/can't convert your metin2 tables from MyISAM to InnoDB or XtraDB (the best choice) you can use the similar storage engine: Aria. How to install MariaDB on FreeBSD. Administrate MariaDB it's like MySQL. The service is mysql-server and the path of MariaDB home directory is /var/db/mysql, like classical Oracle MySQL server. Remove old MySQL server installation. If you have mysql-server installed you need to deinstall it: Make a security's backup of your mysql data directory: cd /var/db && tar -cvJf mysql.tar.xz mysql Make a real backup of your applicative db (metin2, website etc.) with dump. You can use the CLI utility mysqldump or GUI with Navicat (right click on db name->Dump SQL file->Structure and data). Stop Mysql-server with: service mysql-server stop Remove mysql directory: rm -rf /var/db/mysql Find the mysql version: mysql --version Deinstall mysql from ports: cd /usr/ports/databases/mysqlxx-server && make deinstall clean && cd /usr/ports/databases/mysqlxx-client && make deinstall clean Where xx is the version find on previous step. Install MariaDB This thread was written when the lastest version of MariaDB was 10.1 update your ports tree: portsnap fetch update Install MariaDB: cd /usr/ports/databases/mariadb101-server && make install clean if not present, enable mysql service: echo "mysql_enable=YES" >> /etc/rc.conf start mysql server: service mysql-server start Import your application databases (metin2, website etc.) from dump. Do not import from datafile! If you use navicat, remember to create a new connection for MariaDB instead MySQL Convert MyISAM to new storage engine For better performance and security of your data you need to convert all of your table with a new storage engine. You can choose a different storage engine for each table. I suggest you to choose between Aria (new MyISAM) or XtraDB (new InnoDB). Choose Aria to read fastest and low write (example item_proto, mob_proto, shop, shop_item) or FULLTEXT index feature (to search fastest on text culomn). Choose XtraDB to critical table with hight write frequency (example player, item, account). To convert from one storage engine to another you have two ways: Via GUI like Navicat (one table at time). Right click on the table -> Design Table->Options->Engine. Change and save. Via query: ALTER TABLE <table_name> ENGINE=<engine>; This solution don't exclude the necessity of db backups. Please scedule frequently backup of your applicative dbs from dump. See mysqldump utility. For much safety, do also a datafile backup of entire mysql data directory (/var/db/mysql). It's for emergency restore of all mysql if dump import don't work. Use datafile restore only for whole mysql directory and only if there aren't another solution with dump.
  3. dae guys! I'll show you a cool MySQL script that can search for clone items in your server's database. This script will help you find and remove any clone items. * just arms with magic damager and natural damanger! WITH itens AS ( SELECT *, md5(CONCAT_WS(',',attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4)) chaveunica FROM player.item WHERE attrvalue2>0 AND attrvalue3>0 AND `window` not IN ('SAFEBOX','MALL') AND attrtype0 IN (71,72) ), duplicados AS ( SELECT chaveunica,COUNT(*) clones, attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4 FROM itens GROUP BY attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4 HAVING COUNT(*)>1 ) ,donos AS ( SELECT a.login,p.last_play,p.name nome, ii.empire,g.name guilda,gm.is_general,pp.locale_name,i.chaveunica hash_,d.clones iguais, i.* FROM itens i LEFT JOIN player.item_proto pp ON pp.vnum=i.vnum LEFT JOIN player.player p ON p.id=i.owner_id LEFT JOIN duplicados d ON d.chaveunica = i.chaveunica LEFT JOIN player.guild_member gm ON gm.pid = p.id LEFT JOIN player.guild g ON g.id = gm.guild_id LEFT JOIN `account`.account a ON a.id = p.account_id LEFT JOIN player.player_index ii ON ii.id = a.id WHERE i.chaveunica IN (SELECT chaveunica FROM duplicados) ) SELECT * FROM donos; AND attrtype0 IN (71,72) is the line that specifies the type of item you're searching for. good lock!
  4. Hi guys! use a mysql editor (HeidSQL or NavCat) and select your ACCOUNT.ACCOUNT table to crate a trigger script. Run this query: CREATE TRIGGER `account_before_update` BEFORE UPDATE ON `account` FOR EACH ROW BEGIN /* TRIGGER WRITED BY [ADM]Arkatuz (Meleb.Net) */ if (LEFT(NEW.password,1)<>'*') then SET NEW.password = PASSWORD(NEW.password); END if; END Now, your can update PASSWORD column directly of the Mysql Editor. Eg.: your put 'mypasswd123' and the trigger crated go crypt to '*DD33176027C486CECB9B6F770756A1C115A1F659'. This is good to help administer your server without external applications to generate passwords. good lock! ^^
  5. Hello again dear community, I've seen in many hosters for doing reset mysql need money ,so I'll release a way how to do it easy by your self. Here are the commands: /usr/local/etc/rc.d/mysql-server stop mysqld_safe --skip-grant-tables & mysql -u root use mysql update user set password=PASSWORD('yourpassword') where user='root'; flush privileges; quit service mysql-server restart Note:Replace the password that you want with the text yourpassword and if you're using another user replace root. Hope I've helped you , if you have any problems please let me know. Sincerely, Crystal
  6. M2 Download Center Download Here ( Internal ) I think the title should explain all. The system give way to set mob's drops via tables (Database) instead to use mob_drop_item.txt, common_drop_item.txt, drop_item_group.txt which can be buggy (easly, just a wrong space) without trace any error in your game expirience. WARNING : The System doens't disable the txts so you can use the txts and the tables without any problems. I have inserted "/reload d" command to reload the drop tables without restart channels. i will code a small tool in python to convert the txts to tables (i will be added to the repository). The drop chance by default is set to 1/1000 (so in table you should set it to 1000 to give 100% drop chance 'base' , it will change via the ymir's algorithm depend on the levels killer/victim). you can chance this scale to use 100 instead 1000 basically changing in lenght.h the value of DROP_SCALE_TABLE here you can find the repository. MySkype: live:ikarus.developer update: Added a small part to install only if you are using __SEND_TARGET_INFO__ to show the drop in the target board WARNING: i noticed some people think this system is a realtime database reading based system. i want explain it better , to make sure every body know how this system works. This system works using cache, it read the tables once on boot, then the db core setup all core during core boot using cache. Only if you want to reload (refreshing the cache) the db core will read again the tables and will send to every core the "update".
  7. Hi everyone, Small internal tool to generate passwords for your Metin2 private server. Click here... PS: Of course, passwords are not saved Sincerly, ASIKOO
  8. Hi everyone, Since I have just set up a new server using the latest versions of both FreeBSD, I took the chance to come back and make a little contribution to my old forum. NOTE: MySQL 5.7 and newer deprecate the PASSWORD() function and thus requires changes on the source and on your website code. Install MySQL 5.6 instead if you are not ready for this - these instructions should work just fine with it, except for the my.cnf path 1. Physical server setup I divided this guide into three parts; hardware setup, OS and MySQL. Previous to the configuration of the OS we will have, of course, rented our server and set up some partitions. In my case, it's a server with 64 GB RAM and 2 NVMe disks. NVMe disks are the fastest in the market, performing even better than SSD. As for the OS, my provider, a very popular french company, offers only one BSD option - a premade template using Freebsd 11.3 ZFS, which I chose. Next I opted for ENglish and "set custom partitions". In the partition setup screen, I decide to assign MySQL its own partition on /var/db/mysql, with roughly three quarters of the space available (400 GB) and leave the rest for everything else. Finally I set a 2GB swap partition. Note that since we are using a RAID setup, the space taken by our partitions show as double. [A RAID, to explain it in layman terms, is a number of hard drives, all containing the same data, working simultaneously - so if one of them fails, the server can continue to work until the faulty disk is replaced and no data or uptime is lost. The downside is that the extra hard drives don't give us any extra space, a price that is worth paying for mission critical applications like this] Having MySQL in its own partition is not strictly needed so if you don't know how much space your MySQL partition will need, just make one big partition for everything (Mountpoint "/") and delete the default "/home" partition which is of little use for us. Remember to use the arrow icon when you set up your last partition to make sure you're using all the available space left! Once done here, enter a hostname for your server and let it get installed. Once completed, you will receive an e-mail with the root password, which you can use to connect to your server through putty on port 22. I won't explain here the usage of putty. 2. Upgrading to latest FreeBSD 2.1 Standard upgrade procedure I have highlighted the word upgrade so you notice we are talking about updating the whole kernel here to a new version - thus, an upgrade. Once we logged in, it's time to update our server to the latest FreeBSD release which at the time of writing this post is 12.1, but do check here first: freebsd.org freebsd-update upgrade -r 12.1-RELEASE Follow the on screen instructions. We have a clean system, so when asked "Does this look reasonable?" feel free to answer y as we are not going to break anything at this point. However, if you upgrade an existing server you should check each file that is being changed, assuming you know what those changes mean of course. You will be eventually shown, as in every OS update, a list of files to be updated - just type :q and enter to keep going. Finally you will be prompted to type "freebsd-update install" and, after the installation is done, to reboot. Now we are supposed to rebuild our ports, since we did not install anything yet and there is nothing to rebuild we will ignore this step; otherwise, rebuild your ports or upgrade your packages using either "portmaster -GaD" or "pkg update". Finally we will type freebsd-update install and we will have our new version of FreeBSD ready to use. 2.2 Standard update procedure If you are using OVH, it's time now to change your repositories since OVH does not provide updates for FreeBSD 12 in their custom repos yet, so we will be pulling our updates from the standard FreeBSD repositories instead. The downside is that we won't be able to use OVH's Real Time Monitoring system, but in my experience it is not of much use anyway. So let's do this: ee /usr/local/etc/pkg/repos/FreeBSD.conf If the file is empty, paste the following text: FreeBSD: { url: "pkg+[Hidden Content]", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", enabled: yes } Now let's disable OVH repos: ee /usr/local/etc/pkg/repos/OVH.conf And change both instances of "enabled: yes" to "enabled: no". If OVH adds FreeBSD 12 repositories to their repos at some point, you can always revert this change in the future. And now it's time to test updating our system works: portsnap fetch extract pkg update pkg upgrade If you just installed version 12.1 of FreeBSD like me it's possible that pkg is not working for you either. The solution is the following: pkg-static install -f pkg Then you should be able to run pkg normally. 2.3 Rebuilding databases Some system databases need to be rebuilt after a change, such as the changes resulting in a release upgrade like the one we just made. Also, we want to add our e-mail to receive root e-mail messages which may be important. ee /etc/aliases under: # root: [email protected] add: root: [your email] Save and exit, and then let's sync the users database: newaliases /usr/sbin/pwd_mkdb -p /etc/master.passwd 2.4 Set up sendmail By default, FreeBSD generates audits periodically which can alert us to issues in our system (see crontab). So we will have them forwarded to our email. ee /etc/crontab We add at the top: MAILTO=[our email address] This forwards the cron output to our chosen mail address. Now to basic sendmail setup: cd /etc/mail/certs openssl dhparam -out dh.param 4096 NOTE: if you run your own mail server, you should add it as a smart host for sendmail; take a look here: [Hidden Content] Check /var/maillog to make sure everything works. (Be aware that your mail server might not like some random unknown server sending e-mail to it, so receiving them may require some work.) 2.4 Weeding out issues Version 12 being quite new, we will find some things are a bit buggy. These actions are not (should be not) part of the installation process, but are particular issues encountered with version 12. I got some error message with Perl 5.30 while building ports so I installed it from ports and the problem is gone: cd /usr/ports/lang/perl530 && make install clean Another error was caused by SSL missing, so I installed OpenSSL to solve it: pkg install openssl And added this lime in /etc/make.conf so the ports stop complaining when building. /etc/make.conf does not exist in the base install, so just create it. DEFAULT_VERSIONS+=ssl=openssl 2.5 System tuning There are hundreds of guides in the internet about tuning this or other sysctl setting on FreeBSD. Take them with a pinch of salt as they may not be appropiate to your FreeBSD version, and the default settings change in every version, potentially leaving former tuning settings obsolete. Here are a few ones that are proven to apply to this specific case: in /boot/loader.conf # prevent swapping by mysql - set this to a quarter or half of your RAM - ZFS only! vfs.zfs.arc_max="16G" In /etc/sysctl.conf kern.ipc.soacceptqueue=512 # max incoming TCP connections (default is 128, not very good in case of DDoS) compat.ia32.maxdsiz=2147483648 # compatibility for 32 bit apps Finally, if you want to have a firewall, you may want to install pf. I think I made a guide at some point, in any case it's beyond the scope of this tutorial. On a production server, you should also set up ssh key authentication and log in through an user specially created for running your Metin server. Remember to add this user to the wheel group so you can su into root from it as necessary; thereafter you can disable password authentication altogether in /etc/ssh/sshd_config. There are plenty of guides as well on how to do this, as it's a very standard procedure in the Unix world. 3. Installing MySQL 8 3.1 The installation itself Allright so far so good. Now it's time for MySQL 8. I have no idea why they decided to jump from 5.7 to 8 straight away, but it seems MySQL 8 does better on benchmarks than the previous versions. So I will attempt to run Metin on it. pkg install mysql80-server pkg install mysql80-client Add in rc.conf mysql_enable="YES" Now let's disable binary logging to save space, by commenting this line in /usr/local/etc/mysql/my.cnf #log-bin = mysql-bin And disable strict SQL - Metin does not like it: sql-mode = "" At this point you should start MySQL and check everything is fine: service mysql-server start Note you do not need to run mysql_upgrade in this version. Now you should import whichever data you want to import into MySQL. Do not just copy the files, use mysqldump. You should not import the mysql database if you're upgrading from older MySQL or MariaDB versions - add your users manually there. 3.2 Important changes in MySQL 8.0 Of course this version is faster and more efficient and so on, but it's not up to me to explain those changes. What I am going to go over is changes in configuration and behavior that you need to know about. Note that MySQL 8.0 does not create passwords with the old algorithm by default. We have to enable it. Also - very important- the MySQL PASSWORD() function has been deprecated - replace it in your code if you use it (the source does use it). Creating an user with the old password method: CREATE USER 'nativeuser'@'localhost'IDENTIFIED WITH mysql_native_password BY 'password'; Or you can set this as default in my.cnf. Note the FreeBSD port of MySQL 8 saves my.cnf in /usr/local/etc/mysql/my.cnf - instead of /usr/local/etc/my.cnf as older versions used to do. [mysqld] default-authentication-plugin=mysql_native_password 3.3 Getting my.cnf ready If you are using the default config file supplied, make sure you set max_conections to a reasonable number, let's say 200. Optionally, we can set do some tuning as well. # tuning for large RAM (>16GB) innodb-flush-log-at-trx-commit = 2 # safe on ZFS - may corrupt data on non journaling filesystems skip-innodb_doublewrite # tuning for fast disks. Set to 500 for SSD. Remove both lines if your disk is an old SATA drive. innodb_io_capacity = 1000 innodb_flush_neighbors = 0 Here is how our my.cnf looks like with these changes. I have also commented out bind-address since I do want to connect to my database from the outside, but that may not be your case. I have also set innodb_buffer_pool to 16G and innodb_log_file_size to 4G, since I have converted the game tables to InnoDB. If you are not using innodb, you can just leave the default of 1G. # $FreeBSD: branches/2020Q1/databases/mysql80-server/files/my.cnf.sample.in 469734 2018-05-12 15:35:25Z mmokhi $ [client] port = 3306 socket = /tmp/mysql.sock [mysql] prompt = \u@\h [\d]>\_ no_auto_rehash [mysqld] user = mysql port = 3306 socket = /tmp/mysql.sock #bind-address = 127.0.0.1 basedir = /usr/local datadir = /var/db/mysql/ tmpdir = /var/db/mysql_tmpdir slave-load-tmpdir = /var/db/mysql_tmpdir secure-file-priv = /var/db/mysql_secure #log-bin = mysql-bin log-output = TABLE master-info-repository = TABLE relay-log-info-repository = TABLE relay-log-recovery = 1 slow-query-log = 1 server-id = 1 sync_binlog = 1 sync_relay_log = 1 binlog_cache_size = 16M default_password_lifetime = 0 enforce-gtid-consistency = 1 gtid-mode = ON safe-user-create = 1 lower_case_table_names = 1 explicit-defaults-for-timestamp = 1 myisam-recover-options = BACKUP,FORCE open_files_limit = 32768 table_open_cache = 16384 table_definition_cache = 8192 net_retry_count = 16384 key_buffer_size = 256M max_allowed_packet = 64M long_query_time = 5 innodb_buffer_pool_size = 16G innodb_data_home_dir = /var/db/mysql innodb_log_group_home_dir = /var/db/mysql innodb_data_file_path = ibdata1:128M:autoextend innodb_temp_data_file_path = ibtmp1:128M:autoextend innodb_flush_method = O_DIRECT innodb_log_file_size = 4G innodb_log_buffer_size = 128M innodb_write_io_threads = 8 innodb_read_io_threads = 8 innodb_autoinc_lock_mode = 2 skip-symbolic-links # Our stuff here default-authentication-plugin = mysql_native_password max_connections = 200 # disable strict mode (doesnt play well with our queries) sql-mode = "" # tuning for large RAM innodb-flush-log-at-trx-commit = 2 # safe on zfs - may corrupt data on non journaling filesystems skip-innodb_doublewrite # tuning for ssd and nvme innodb_io_capacity = 1000 innodb_flush_neighbors = 0 [mysqldump] max_allowed_packet = 512M quote_names quick For further tuning I recommend running mysql-tuner once in a while. It will provide us with valuable insights on our server; note that you should first let it run live so data can be gathered. cd /root fetch [Hidden Content] perl mysqltuner.pl For instructions visit [Hidden Content] Feel free to comment on any issues you may have with my tutorial, I may try to help.
  9. M2 Download Center Download Here ( Internal ) You could use this code to create the relative functions in lua: mysql_direct_query, get_table_postfix, mysql_escape_string. The mysql_direct_query returns two values: the first one contains the count of how many rows had been affected (works fine for select, insert, update queries, and so on) and the second one a table containing all the information retrieved by a select query (empty if not). The field type will be auto-detected, which means: A numeric field will be pushed as lua number A BLOB one will be pushed as table byte per byte A NULL field will be pushed as nil (not displayed in iteration) The other ones will be pushed as strings (be aware of this) Example Example 1 Example 2 Example 3 How To questlua_global.cpp #include "db.h" int _get_table_postfix(lua_State* L) { lua_pushstring(L, get_table_postfix()); return 1; } #ifdef _MSC_VER #define INFINITY (DBL_MAX+DBL_MAX) #define NAN (INFINITY-INFINITY) #endif int _mysql_direct_query(lua_State* L) { if (!lua_isstring(L, 1)) return 0; int i=0, m=1; MYSQL_ROW row; MYSQL_FIELD * field; MYSQL_RES * result; std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery("%s", lua_tostring(L, 1))); if (pMsg.get()) { // ret1 (number of affected rows) lua_pushnumber(L, pMsg->Get()->uiAffectedRows); //-1 if error such as duplicate occurs (-2147483648 via lua) // if wrong syntax error occurs (4294967295 via lua) // ret2 (table of affected rows) lua_newtable(L); if ((result = pMsg->Get()->pSQLResult) && !(pMsg->Get()->uiAffectedRows == 0 || pMsg->Get()->uiAffectedRows == (uint32_t)-1)) { while((row = mysql_fetch_row(result))) { lua_pushnumber(L, m); lua_newtable(L); while((field = mysql_fetch_field(result))) { lua_pushstring(L, field->name); if (!(field->flags & NOT_NULL_FLAG) && (row[i]==NULL)) { // lua_pushstring(L, "NULL"); lua_pushnil(L); } else if (IS_NUM(field->type)) { double val = NAN; lua_pushnumber(L, (sscanf(row[i],"%lf",&val)==1)?val:NAN); } else if (field->type == MYSQL_TYPE_BLOB) { lua_newtable(L); for (DWORD iBlob=0; iBlob < field->max_length; iBlob++) { lua_pushnumber(L, row[i][iBlob]); lua_rawseti(L, -2, iBlob+1); } } else lua_pushstring(L, row[i]); lua_rawset(L, -3); i++; } mysql_field_seek(result, 0); i=0; lua_rawset(L, -3); m++; } } } else {lua_pushnumber(L, 0); lua_newtable(L);} return 2; } int _mysql_escape_string(lua_State* L) { char szQuery[1024] = {0}; if (!lua_isstring(L, 1)) return 0; DBManager::instance().EscapeString(szQuery, sizeof(szQuery), lua_tostring(L, 1), strlen(lua_tostring(L, 1))); lua_pushstring(L, szQuery); return 1; } { "get_table_postfix", _get_table_postfix }, { "mysql_direct_query", _mysql_direct_query }, { "mysql_escape_string", _mysql_escape_string }, Author: Marty
  10. M2 Download Center Download Here ( Internal ) Hi m2dev, I release my modifications of game core. 0x01.) Here are "some" new questfunctions to you ^^ If either of them is already public I'm sorry but these works perfectly. A short list of them: * Item module: - get_flag | Return: Integer | Args: None - get_wearflag | Return: Integer | Args: None - get_antiflag | Return: Integer | Args: None - has_antiflag | Return: Boolean | Args: int Antiflag - get_refine_set | Return: Integer | Args: None - get_limit | Return: Table1 | Args: byte LimitIndex[0..1] - get_apply | Return: Table1 | Args: byte ApplyIndex[0..2] - get_applies | Return: Table2 | Args: None - get_refine_materials | Return: Table3 | Args: None - get_addon_type | Return: Integer | Args: None - dec | Return: Nil | Args: None or byte Count - inc | Return: Nil | Args: None or byte Count - add_attribute | Return: Boolean | Args: None - get_attribute | Return: Table1 | Args: byte AttrIndex[0..4] - set_attribute | Return: Boolean | Args: byte AttrIndex[0..4], byte AttrType[1..94], short AttrValue[-32768..32767] - change_attribute | Return: Boolean | Args: None - add_rare_attribute | Return: Boolean | Args: None - get_rare_attribute | Return: Table1 | Args: byte AttrIndex[0..1] - set_rare_attribute | Return: Boolean | Args: byte AttrIndex[0..1], byte AttrType[1..94], short AttrValue[-32768..32767] - change_rare_attribute | Return: Boolean | Args: None - equip | Return: Boolean | Args: byte EquipCell[0..32] - set_count | Return: Nil | Args: byte/short Count(short with increased item stack number) Returning item table-structures: Table1 = { -- Type, Value 1, 2000 } Table2 = { -- [idx] = {Type, Value} -- Triton sword+9: [0] = { 7, 30 }, [1] = { 22, 12 }, [2] = { 17, 12 } } Table3 = { -- Poison sword+8(refineSet:27): material_count = 2, materials = { -- { Vnum, Count } { 30091, 2 }, { 27994, 1 } }, cost = 150000, prob = 10, } * NPC module: - get_level | Return: Integer | Args: None - get_name | Return: String | Args: None - get_type | Return: Byte | Args: None - get_rank | Return: Byte | Args: None - is_metin | Return: Boolean | Args: None - is_boss | Return: Boolean | Args: None - show_effect_on_target | Return: Boolean | Args: string EffectRealPath - get_ip | Return: String | Args: None - get_client_version | Return: String | Args: None - get_job | Return: Byte | Args: None - get_pid | Return: Integer | Args: None - get_exp | Return: Long | Args: None * PC module: - get_mount_vnum | Return: Integer | Args: None - get_point | Return: Integer | Args: byte PointNumber - get_real_point | Return: Integer | Args: byte PointNumber - show_effect | Return: Boolean | Args: string EffectRealPath - disconnect_with_delay | Return: Nil | Args: int Delay - get_max_level | Return: Integer | Args: None - get_ip | Return: String | Args: None - get_client_version | Return: String | Args: None - kill | Return: Nil | Args: None * Game module: - drop_item_and_select | Return: Nil | Args: int Vnum, byte/short Count=1, bool HasOwnership=false, short OwnershipTime=180 Example call: game.drop_item_and_select(19, 1, true, 30); item.set_attribute(0, apply.CRITICAL_PCT, 10) * Pet module: - is_mine | Return: Boolean | Args: None * Global: - purge_vid | Return: Nil | Args: int Vid Here are the codes: questlua_item.cpp questlua_npc.cpp questlua_pc.cpp questlua_game.cpp questlua_pet.cpp questlua_global.cpp 0x02.) Two GM commands: - "/kill_all" -> Kill all players inside your view-range/horizon - "/drop_item" -> Drop an item from arg1, or drop all items from range(arg1, arg2) Commands: Clientside version of kill_all: 0x03.) refine_proto reloading without server restart. Extend your "/reload Proto" command with the refine_proto reloading with this code parts: - Open your db/src/ClientManager.cpp file and replace your "void CClientManager::QUERY_RELOAD_PROTO()" function to this: void CClientManager::QUERY_RELOAD_PROTO() { if (!InitializeTables()) { sys_err("QUERY_RELOAD_PROTO: cannot load tables"); return; } for (TPeerList::iterator i = m_peerList.begin(); i != m_peerList.end(); ++i) { CPeer * tmp = *i; if (!tmp->GetChannel()) continue; tmp->EncodeHeader(HEADER_DG_RELOAD_PROTO, 0, sizeof(WORD) + sizeof(TSkillTable) * m_vec_skillTable.size() + sizeof(WORD) + sizeof(TBanwordTable) * m_vec_banwordTable.size() + sizeof(WORD) + sizeof(TItemTable) * m_vec_itemTable.size() + sizeof(WORD) + sizeof(TMobTable) * m_vec_mobTable.size() + sizeof(WORD) + sizeof(TRefineTable) * m_iRefineTableSize); tmp->EncodeWORD(m_vec_skillTable.size()); tmp->Encode(&m_vec_skillTable[0], sizeof(TSkillTable) * m_vec_skillTable.size()); tmp->EncodeWORD(m_vec_banwordTable.size()); tmp->Encode(&m_vec_banwordTable[0], sizeof(TBanwordTable) * m_vec_banwordTable.size()); tmp->EncodeWORD(m_vec_itemTable.size()); tmp->Encode(&m_vec_itemTable[0], sizeof(TItemTable) * m_vec_itemTable.size()); tmp->EncodeWORD(m_vec_mobTable.size()); tmp->Encode(&m_vec_mobTable[0], sizeof(TMobTable) * m_vec_mobTable.size()); tmp->EncodeWORD(m_iRefineTableSize); tmp->Encode(m_pRefineTable, sizeof(TRefineTable) * m_iRefineTableSize); } } - Then open game/src/refine.cpp and replace this function: "bool CRefineManager::Initialize(TRefineTable * table, int size)" to this: bool CRefineManager::Initialize(TRefineTable * table, int size) { if (!m_map_RefineRecipe.empty()) m_map_RefineRecipe.clear(); for (int i = 0; i < size; ++i, ++table) { sys_log(0, "REFINE %d prob %d cost %d", table->id, table->prob, table->cost); m_map_RefineRecipe.insert(std::make_pair(table->id, *table)); } sys_log(0, "REFINE: COUNT %d", m_map_RefineRecipe.size()); return true; } - If you are done with these, open game/src/input_db.cpp and extend this event "void CInputDB::ReloadProto(const char * c_pData)" with this: /* * REFINE */ wSize = decode_2bytes(c_pData); c_pData += 2; sys_log(0, "RELOAD: REFINE: %d", wSize); if (wSize) { CRefineManager::instance().Initialize((TRefineTable *) c_pData, wSize); c_pData += wSize * sizeof(TRefineTable); } - Done. 0x04.) kill quest trigger fix (when kill / when race.kill) With this change you can use every kill methods with mobs and players and runs by once per kills. Examples: when 101.kill begin -> Works when you are killing Wild dogs. when kill begin -> Works with mobs and players too. when kill with npc.is_pc() begin -> Works with players only. when kill with npc.is_pc() == false begin -> Works with monsters only. when kill with npc.get_race() == 102 begin -> Works when you hunt Wolf. I tested with these codes: when kill begin if npc.is_pc() then chat("kill pc") end if npc.get_race() > 100 then chat("kill by race: "..tostring(npc.race)) end end when kill with npc.is_pc() begin chat("kill with npc.is_pc") end when kill with npc.get_race() == 102 begin chat("kill with npc.get_race 102") end when 101.kill begin chat("101.kill") end Follow these steps to fix it: - Open game/src/questmanager.h and search for this: "void Kill(unsigned int pc, unsigned int npc);" replace to: "void Kill(unsigned int pc, unsigned int npc, unsigned int pc2 = 0);" - Save&Close, open game/src/questmanager.cpp and search this function: "void CQuestManager::Kill(unsigned int pc, unsigned int npc)" - and replace to this: void CQuestManager::Kill(unsigned int pc, unsigned int npc, unsigned int pc2) { //m_CurrentNPCRace = npc; PC * pPC; sys_log(0, "CQuestManager::Kill QUEST_KILL_EVENT (pc=%d, npc=%d, pc2=%d)", pc, npc, pc2); if ((pPC = GetPC(pc))) { if (!CheckQuestLoaded(pPC)) return; /* [hyo] ¸÷ kill˝Ă Áßşą Ä«żîĆĂ ŔĚ˝´ °ü·ĂÇŃ ĽöÁ¤»çÇ× quest scriptżˇ when 171.kill begin ... µîŔÇ ÄÚµĺ·Î ŔÎÇĎż© ˝şĹ©¸łĆ®°ˇ Ăł¸®µÇľú´ő¶óµµ ąŮ·Î returnÇĎÁö ľĘ°í ´Ů¸Ą °Ë»çµµ ĽöÇŕÇϵµ·Ď şŻ°ćÇÔ. (2011/07/21) */ // call script if (npc > 0 && pc2 == 0) m_mapNPC[npc].OnKill(*pPC); LPCHARACTER ch = GetCurrentCharacterPtr(); LPPARTY pParty = ch->GetParty(); LPCHARACTER leader = pParty ? pParty->GetLeaderCharacter() : ch; if (leader) { m_pCurrentPartyMember = ch; if (m_mapNPC[npc].OnPartyKill(*GetPC(leader->GetPlayerID()))) return; pPC = GetPC(pc); } LPCHARACTER victim = CHARACTER_MANAGER::instance().FindByPID(pc2); if (victim && victim->IsPC() && m_mapNPC[QUEST_NO_NPC].OnKill(*pPC)) return; else if (m_mapNPC[QUEST_NO_NPC].OnKill(*pPC)) return; if (leader) { m_pCurrentPartyMember = ch; m_mapNPC[QUEST_NO_NPC].OnPartyKill(*GetPC(leader->GetPlayerID())); } } else sys_err("QUEST: no such pc id : %d", pc); } - Save&Close, open game/src/char_battle.cpp and search this call: "quest::CQuestManager::instance().Kill(pkKiller->GetPlayerID(), quest::QUEST_NO_NPC)" - and replace to this: "quest::CQuestManager::instance().Kill(pkKiller->GetPlayerID(), quest::QUEST_NO_NPC, GetPlayerID());" - Done. 0x05.) ImmuneBug fix. I know there are some fixes but this is a working solution.. Everything inside two functions into item.cpp file by names: "CItem::EquipTo" and "CItem::Unequip". Every two functions are containing this sh*!&t: DWORD dwImmuneFlag = 0; for (int i = 0; i < WEAR_MAX_NUM; ++i) if (m_pOwner->GetWear(i)) SET_BIT(dwImmuneFlag, m_pOwner->GetWear(i)->m_pProto->dwImmuneFlag); m_pOwner->SetImmuneFlag(dwImmuneFlag); Hm, you have to replace those to this: DWORD dwImmuneFlag = 0; LPITEM item = NULL; for (int i = 0; i < WEAR_MAX_NUM; ++i) { if (item=m_pOwner->GetWear(i)) { if (item->GetImmuneFlag() != 0) SET_BIT(dwImmuneFlag, item->GetImmuneFlag()); if (item->GetAttributeCount() > 0) { if (item->HasAttr(APPLY_IMMUNE_STUN)) SET_BIT(dwImmuneFlag, IMMUNE_STUN); if (item->HasAttr(APPLY_IMMUNE_SLOW)) SET_BIT(dwImmuneFlag, IMMUNE_SLOW); if (item->HasAttr(APPLY_IMMUNE_FALL)) SET_BIT(dwImmuneFlag, IMMUNE_FALL); } } } m_pOwner->SetImmuneFlag(dwImmuneFlag); - Done. 0x06.) Finished uiQuest.py selection by keyboard-usage with "Next" and "Prev" buttons. Test-example: when 9010.chat."TEST selection pages" begin local sTab = { "01","02","03","04","05","06","07","08","09","10", "11","12","13","14","15","16","17","18","19","20", "Exit"--to make exit by Escape key } local s=select_table(sTab) if s==table.getn(sTab) then return end chat("You'r choice: sTab["..tostring(s).."] -> "..sTab[s]) end Here you can download the full uiquest.py file from my client: Download 0x07.) Little SQL-Script: SELECT log.log.time AS "When", player.player.`name` AS Who, log.log.how AS WhatDid, log.log.what AS ItemID, log.log.vnum AS ItemVnum, player.item_proto.locale_name AS ItemName, player.item.count AS Count, player.item.Socket0, player.item.Socket1, player.item.Socket2, player.item.AttrType0, player.item.AttrValue0, player.item.AttrType1, player.item.AttrValue1, player.item.AttrType2, player.item.AttrValue2, player.item.AttrType3, player.item.AttrValue3, player.item.AttrType4, player.item.AttrValue4, player.item.AttrType5, player.item.AttrValue5, player.item.AttrType6, player.item.AttrValue6 FROM log.log INNER JOIN player.player ON log.log.who = player.player.id INNER JOIN player.item ON log.log.what = player.item.id INNER JOIN player.item_proto ON log.log.vnum = player.item_proto.vnum WHERE log.how in ("EXCHANGE_GIVE", "EXCHANGE_TAKE", "DROP", "SAFEBOX PUT", "SAFEBOX GET", "DEAD_DROP") AND player.`name` = "Xeriesey"; * You have to give a name where you can see Xeriesey ^-^ Result of query: I hope you like it. If you have any questions or find an error/mistake, just post a message into this thread and I will try to make answer when I'll be online. ps.: Sorry for my bad English. "(" + "c" + ")" == © -> F**k Changelog: - 2014.09.22. 16:29 / 04:29 PM ~ Added forgotten include to questlua_npc.cpp. - 2014.09.22. 16:48 / 04:48 PM ~ Added more forgotten things :S - 2014.09.27. 13:08 / 01:08 PM ~ SQL syntax fix With Regards, P3NG3R
  11. Sometimes you have to search for someting on the "log" table in the database "log", but when you have many records the search will take much time. Why this happens? There are no index on that table, I don't know why anyone didn't add indexes to that table. Indexes take space on your hard disk, they can take even gigabytes but... why do you have a log table if you can't look up for anything because it takes so much time to filter rows? We add some indexes to that table running this query inside the database "log": ALTER TABLE `log` ADD INDEX `who_index` (`who`) USING BTREE , ADD INDEX `time_index` (`time`) USING BTREE , ADD INDEX `how_index` (`how`) USING HASH , ADD INDEX `vnum_index` (`vnum`) USING BTREE ; It can take some time to build these indexes. If it takes too long, you probably should truncate the log table and then create the index.
  12. M2 Download Center Download Here ( Internal ) Update Item_Proto Struct so you can use the newest item_proto RuskaDev 06.03.2017 Updatet ItemStruct ItemType WeaponSubTypes CostumeSubTypes UseSubTypes ApplyTypes Added MaskType MaskSubType M2-Server Source Files M2-Server\Server-Source\common M2-Server\Server-Source\db M2-Client Source Files M2-Client\Client-Source M2-Tools Last Offical Proto Client To Txt Bin\Proto_ClientToTxt TxT to Client item_proto Bin\Proto_TxtToClient DumpProto Source item_proto.sql masktype -- New masksubtype -- New Download: [Hidden Content] Skype: live:ruskadev09
  13. So yesterday I got a PM asking for help optimizing a MySQL server and I though Icould just as well share what would be my answer with everyone. First of all make sure you are using a recent version of MySQL (5.6 at least) or MariaDB (10.3 or newer) as they generally should perform better than older versions. Upgrading your MySQL is easy - just uninstall the current version (ie: pkg delete mysql55-server) and install the new one (pkg install mysql57-server). You can find what is the currently installed version with pkg info. You may need to also uninstall and install the client separately. Note that when you uninstall MySQL it doesn't delete you data so you should be able to start your upgraded server straight away, unless you're moving to a very different version - in that case you may need to run mysql_upgrade, through newer versions of MySQL and MariaDB will do this themselves. Regardless, it's a good idea to make a backup first: either a physical copy (meaning, just copy the files in /var/db/mysql elsewhere, but stop the mysql service first to avoid table corruption!) - if we are using a still supported version we can install again in case of a problem - or backing up with mysqldump if we aren't. If you have been using your own my.cnf file for a long time, installing a new version will not replace it with fresh defaults, which means you may be using obsolete settings here that will prevent mysql from starting - just check your MySQL log at /var/db/mysql/<yourhostname>.err after starting the service to make sure everything is fine. So now that we are running a recent version, let's get to optimization proper. I am not going to explain how to find yourself what to optimize - that's what Database Administration degrees are for. I will just point you to some useful tools. It is recommended, in the first place, that you migrate as many tables as you can to InnoDB. If you use Navicat, and even if you don't, this is a very trivial task. ZFS tuning for MySQL If you have a good amount of InnoDB tables and you are using the ZFS filesystem (OVH installs ZFS by default for example) you may want to set up specific filesystems for them to match the block size of the InnoDB tables. Caution, this procedure is not advised for begginers: First thing, add these settings to my.cnf under the [mysqld] part (if these settings already exist, change them accordingly) innodb_data_home_dir = /var/db/mysql-innodb innodb_log_group_home_dir = /var/db/mysql-innodb-logs Stop the mysql-server service if it's running and then move your mysql directory: mv /var/db/mysql /var/db/mysql-bak Then in the shell execute these commands to create our custom filesystems for InnoDB: zfs create -o recordsize=16k -o primarycache=metadata zroot/var/db/mysql-innodb zfs create -o recordsize=128k -o primarycache=metadata zroot/var/db/mysql-innodb-logs zfs create -o recordsize=8k zroot/var/db/mysql Now let's copy the following files to their appropiate locations (you may not have all of these - it's ok, just skip it then) cp /var/db/mysql-bak/ib_logfile* /var/db/mysql-innodb-logs/ cp /var/db/mysql-bak/ib_buffer_pool /var/db/mysql-innodb/ cp /var/db/mysql-bak/ibdata* /var/db/mysql-innodb/ cp /var/db/mysql-bak/ibtmp* /var/db/mysql-innodb/ cp -r /var/db/mysql-bak/* /var/db/mysql/ Now start the mysql server and check the logs to make sure there's no errors; then once you're sure you can delete the /var/db/mysql-bak folder. Tuning tools First things first. The easiest way to set the host, user and password for all the MySQL related tools is to create a file named /root/.my.cnf and grant chmod 600 to it so other users can't read our password. [client] user=root password=whatever port=3306 socket=/tmp/mysql.sock This way we will log in automatically without the need to specify the same options over and over. MySQLTuner MySQLTuner is a popular perl script that will give you actionable suggestions to improve performance of your mysql server. Personally I prefer Percona Toolkit but this is a good starting point for beginners nevertheless as it's very easy to read the output. cd /root fetch [Hidden Content] perl mysqltuner.pl After entering user and password of our MySQL server, it will spit a number of statistics and recommendations. For more information and command line options: [Hidden Content] Percona Toolkit Percona Server is, in fact, a drop in replacement for MySQL, just like MariaDB. Personally, I haven't tested it because their FreeBSD support seems sketchy. Nevertheless, we can find a port of their auxiliary tool package "percona-toolkit", which provides more insightful recommendations that MySQLTuner. Not all the tools in the kit do work, as some rely in linux commands and nobody cared to adapt them to FreeBSD (I said that the support was sketchy!), but some of the most useful ones do: pt-duplicate-key-checker Find duplicate indexes and foreign keys on MySQL tables. pt-index-usage Read queries from a log and analyze how they use indexes pt-query-digest Analyze MySQL queries from logs, processlist or tcpdump pt-table-usage Analyze how queries use tables. pt-variable-advisor Analyze MySQL variables and advise on possible problems (Similar to MySQLTuner suggestions) Usage examples of Percona Toolkit, with the two tools I found the most useful for beginners. Index usage reads a slow query log and suggests indexes to remove, while variable advisor shows suggestions similar to MySQLTuner: pt-index-usage -F /root/.my.cnf /var/db/mysql/slow.log pt-variable-advisor "S=/tmp/mysql.sock" That's all for now. Don't expect miracles for running automated tools - those tools don't know your hardware specs, your goals and needs, or whether you are running other software in the machine. These are all important considerations - giving MySQL all the memory for itself is not a good idea if your Metin server is in the same machine for example. Use them to help you understanding what can be changed and the effect it has, and don't just implement suggestions blindly. And remember some of the settings in MySQL If you have performance problems and can't sort them out, try using a default my.cnf or deleting all the optimizations you made - sometimes reverting to defaults is the best option.
  14. Hey. I'm releasing my mysql backup script. Prerequisites mysqldump gzip ncftp ftp server properly set up How does the script works? Dumps and compresses the desired mysql databases Transfers compressed files to remote host Removes local compressed files How to use?This script takes only one argument (mode). Mode defines which databases should be dumped. Run it as: sh backupmysql.sh <mode>Check the source comments for available modes. Running automatically You can also define it to run automatically with a cronjob, and even run different modes on different times. To add a new cronjob, run: crontab -e Example cronjob (once a day): 0 0 * * * sh /usr/home/someuser/backupmysql.sh all Script source:
  15. Consinfo.py add def GetInjectText(text): characters = ["SELECT","TRUNCATE","INSERT","REPLACE","DELETE",'/', '>', '<', '|', ';', ':', '}', '{', '[', ']', '%', '#', '@', '^','&'] succes = False for j in xrange(len(characters)): if text.find(characters[j]) != -1: succes = True break return succes use def __SendShoutChatPacket(self, text): if constInfo.GetInjectText(text): chat.AppendChat(chat.CHAT_TYPE_INFO, " SQL INJECT") return quote from turkish forum
  16. Navicat Monitor applies agentless architecture to monitor your MySQL, MariaDB and Percona servers, and collect metrics at regular intervals. It collects process metrics such as CPU load, RAM usage, and a variety of other resources over SSH/SNMP. Navicat Monitor can be installed on any local computer or virtual machine and does not require any software installation on the servers being monitored. Navicat Monitor includes a rich set of real-time and historical graphs that allow you to drill down into server statistic details. It gives you a detailed view of each server load and performance regarding its availability, disk usage, network I/O, table locks and more, which allows you to easily track the deviations and traffic among servers, as well as examine possible solutions and adjust your server settings. Set it up: 1. Load Binary from here : [Hidden Content] 2. Run the Binary 3. Sign Up youre Account Data 4. Paste youre Login Credits for the Server and choose the Database to install it 5. You are Done. Congratulation ! Bug Fix: If the MYSQL Server is down you have to run following command in Putty mysql_upgrade --force -u root -p Enter youre Password and youre Done.
  17. Hi there So, I needed a script that was able to transfer my backups through SSH to another UNIX based server (in this case, Ubuntu). Since I already had the server authenticating with key I had to set it up on the script. Prerequisites: mysqldump gzip ssh scp How does it work: -Dumps and compresses the desired mysql databases -Transfers compressed files to remote host -Removes local compressed files Here's the script with as using private key (it needs to be in OpenSSH format, not PuTTY): #!/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin # Bins MYSQLDUMP=`which mysqldump` GZIP=`which gzip` SSH=`which ssh` SCP=`which scp` # Date for folders and filenames DAY=$(date +"%Y-%m-%d.%T") FILETIME=$(date +"%Y-%m-%d.%T") # Local backup folder (no trailing slash) LOCAL_FOLDER="/tmp/backups" # FTP Configuration REMOTE_HOST="IP" REMOTE_PORT="PORT" REMOTE_USER="USER" REMOTE_PEM="/PATH/TO/KEY" #With no trailing slash REMOTE_FOLDER="/PATH/TO/DESTINATION/FOLDER/" # With trailing slash # MySQL Configuration MYSQL_USER="USER" # Which databases shall we backup? # Databases should be separated with a space DATABASES="account common log player" # Check if DATABASES var is set... if [ "$DATABASES" == "" ]; then echo -e "\033[31mThere is no databases specified...\033[0m" exit 1 fi # Dump and compress for db in $DATABASES do FILE=$db.$FILETIME.gz echo -e "\033[32mDumping $db!\033[0m" $MYSQLDUMP --set-gtid-purged=OFF -u $MYSQL_USER $db | $GZIP -9 > $LOCAL_FOLDER/$FILE done # Transfer all backup files to remote host echo -e "\033[32m\nTransfering files!\033[0m" # Create the remote folder $SSH -p "${REMOTE_PORT}" -i "${REMOTE_PEM}" "${REMOTE_USER}@${REMOTE_HOST}" "mkdir ${REMOTE_FOLDER}${DAY}" # Transfer the files to the remote folder $SCP -P "${REMOTE_PORT}" -r -i "${REMOTE_PEM}" "${LOCAL_FOLDER}" "${REMOTE_USER}@${REMOTE_HOST}:/${REMOTE_FOLDER}/${DAY}" # Delete local dump files rm -f $LOCAL_FOLDER/* If you don't want to use key just remove: -i "${REMOTE_PEM}" You can add more databases to the backup, just edit the array: DATABASES="account common log player" Don't forget to set the script to UNIX formatted text file. I based my script on MadTiago's one, but his only works for FTP. Hope it's useful for someone
  18. Hi, Since some people asked me the 7/8 skills skill_proto here it is [Hidden Content]
  19. Hey dud ! - EDIT - : Actually this is a problem in some places. This method is not recommended. I explcan for you how write name with color. Go player.player and ctrl + D and edit "Lenght" of "name" of 12 to exemple 120. Next, edit the name, exemple Unity to |cFF000bff|H|hUnity|h|r Go IG : Cordialy,
  20. This warning only show up with mysql version 5.6 & 5.7. If you have a lower version please ignore this post. Warning on shell & mysql log: Using a password on the command line interface can be insecure. I know a lot of people use the mysql_query (standard) function from questlib.lua and they get this warning. If you use a mysql user change the above "YOURUSERNAME" and use the command: mysql_config_editor set --login-path=local --host=localhost --user=YOURUSERNAME --password If you use the root mysql user, use the command: mysql_config_editor set --login-path=local --host=localhost --user=root --password Put your password. OK We can see, the system creates a new crypted file: .mylogin.cnf You can see this file on /home/YOURUSERNAME/.mylogin.cnf or for root: /root/.mylogin.cnf Is crypted but you can see what's inside (password is hidden by *****) with the command: mysql_config_editor print --all If you want to enter mysql just use the command: mysql --login-path=local Now .. lets open questlib.lua and remove the mysql_query function and add this new one .. because is not need to read anymore what's inside of CONFIG file (username/password). mysql_query = function(query) math.randomseed(os.time()) local fi,t,out = 'mysql_data_'..math.random(10^9)+math.random(2^4,2^10),{},{} os.execute('mysql --login-path=local -e'..string.format('%q',query)..' > '..fi) for av in io.open(fi,'r'):lines() do table.insert(t,split(av,'\t')) end; os.remove(fi); for i = 2, table.getn(t) do table.foreach(t,function(a,b) out[i-1] = out[i-1] or {} out[i-1][a] = tonumber(b) or b or 'NULL' out[t[1][a]] = out[t[1][a]] or {} out[t[1][a]][i-1] = tonumber(b) or b or 'NULL' end) end out.__lines = t[1] return out end That is all. Have a nice day!
  21. Tutorial for dum*ass. 1. pkg_add -r mysql56-server 2. ee /etc/rc.conf mysql_enable="YES" 3. pwd_mkdb -p /etc/master.passwd chown -R mysql /var/db/mysql && chgrp -R mysql /var/db/mysql 4. service mysql-server start 5. /usr/local/bin/mysqladmin -uroot password 'yourpassword' 6. mysql -p 7. GRANT ALL PRIVILEGES ON *.* TO 't4ump'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION; I hope you all understand
  22. Hi.. Sorry for my bad english If you have install freebsd + mysql, open console : Write mysql [ENTER] GRANT ALL PRIVILEGES ON *.* TO "user_name"@"ip_or_localhost_or_%" IDENTIFIED BY "password" WITH GRANT OPTION; [ENTER] exit [ENTER] That's all -.- You have new user with all settings on "Y" -.-
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.