oldpassword mysql_我想使用mysql old_password,但我无法完成配置

我试图完成一个配置,在我最后一个版本的wamp上使用mysql old_password,但是我不能,因为我需要在my.ini中设置old_passwords,并且在文件中找不到它。

任何人都知道这个位置在哪里?

坦克...

我的my.ini如下:

# Example MySQL config file for medium systems.

#

# This is for a system with little memory (32M - 64M) where MySQL plays

# an important part, or systems up to 128M where MySQL is used together with

# other programs (such as a web server)

#

# You can copy this file to

# /etc/my.cnf to set global options,

# mysql-data-dir/my.cnf to set server-specific options (in this

# installation this directory is C:\mysql\data) or

# ~/.my.cnf to set user-specific options.

#

# In this file, you can use all long options that a program supports.

# If you want to know which options a program supports, run the program

# with the "--help" option.

# The following options will be passed to all MySQL clients

[client]

#password = your_password

port = 3306

socket = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server

[wampmysqld]

port = 3306

socket = /tmp/mysql.sock

key_buffer = 16M

max_allowed_packet = 1M

table_cache = 64

sort_buffer_size = 512K

net_buffer_length = 8K

read_buffer_size = 256K

read_rnd_buffer_size = 512K

myisam_sort_buffer_size = 8M

basedir=c:/wamp/bin/mysql/mysql5.5.16

log-error=c:/wamp/logs/mysql.log

datadir=c:/wamp/bin/mysql/mysql5.5.16/data

# Don't listen on a TCP/IP port at all. This can be a security enhancement,

# if all processes that need to connect to mysqld run on the same host.

# All interaction with mysqld must be made via Unix sockets or named pipes.

# Note that using this option without enabling named pipes on Windows

# (via the "enable-named-pipe" option) will render mysqld useless!

#

#skip-networking

# Disable Federated by default

skip-federated

# Replication Master Server (default)

# binary logging is required for replication

log-bin=mysql-bin

# binary logging format - mixed recommended

binlog_format=mixed

# required unique id between 1 and 2^32 - 1

# defaults to 1 if master-host is not set

# but will not function as a master if omitted

server-id = 1

# Replication Slave (comment out master section to use this)

#

# To configure this host as a replication slave, you can choose between

# two methods :

#

# 1) Use the CHANGE MASTER TO command (fully described in our manual) -

# the syntax is:

#

# CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=,

# MASTER_USER=, MASTER_PASSWORD= ;

#

# where you replace , , by quoted strings and

# by the master's port number (3306 by default).

#

# Example:

#

# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,

# MASTER_USER='joe', MASTER_PASSWORD='secret';

#

# OR

#

# 2) Set the variables below. However, in case you choose this method, then

# start replication for the first time (even unsuccessfully, for example

# if you mistyped the password in master-password and the slave fails to

# connect), the slave will create a master.info file, and any later

# change in this file to the variables' values below will be ignored and

# overridden by the content of the master.info file, unless you shutdown

# the slave server, delete master.info and restart the slaver server.

# For that reason, you may want to leave the lines below untouched

# (commented) and instead use CHANGE MASTER TO (see above)

#

# required unique id between 2 and 2^32 - 1

# (and different from the master)

# defaults to 2 if master-host is set

# but will not function as a slave if omitted

#server-id = 2

#

# The replication master for this slave - required

#master-host =

#

# The username the slave will use for authentication when connecting

# to the master - required

#master-user =

#

# The password the slave will authenticate with when connecting to

# the master - required

#master-password =

#

# The port the master is listening on.

# optional - defaults to 3306

#master-port =

#

# binary logging - not required for slaves, but recommended

#log-bin=mysql-bin

# Point the following paths to different dedicated disks

#tmpdir = /tmp/

#log-update = /path-to-dedicated-directory/hostname

# Uncomment the following if you are using InnoDB tables

#innodb_data_home_dir = C:\mysql\data/

#innodb_data_file_path = ibdata1:10M:autoextend

#innodb_log_group_home_dir = C:\mysql\data/

#innodb_log_arch_dir = C:\mysql\data/

# You can set .._buffer_pool_size up to 50 - 80 %

# of RAM but beware of setting memory usage too high

#innodb_buffer_pool_size = 16M

#innodb_additional_mem_pool_size = 2M

# Set .._log_file_size to 25 % of buffer pool size

#innodb_log_file_size = 5M

#innodb_log_buffer_size = 8M

#innodb_flush_log_at_trx_commit = 1

#innodb_lock_wait_timeout = 50

[mysqldump]

quick

max_allowed_packet = 16M

[mysql]

no-auto-rehash

# Remove the next comment character if you are not familiar with SQL

#safe-updates

[isamchk]

key_buffer = 20M

sort_buffer_size = 20M

read_buffer = 2M

write_buffer = 2M

[myisamchk]

key_buffer = 20M

sort_buffer_size = 20M

read_buffer = 2M

write_buffer = 2M

[mysqlhotcopy]

interactive-timeout

[mysqld]

port=3306

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
【vn.py】CTP首次登陆修改密码 之 接口调用法 c++量化 阅读约 7 分钟 编辑 背景 最近一直在玩vn.py,上一篇文章vn.py开发环境搭建(windows)介绍了如何搭建二次开发环境,解决了一些搭建环境过程中遇到的坑。那么接下来这篇文章将解决运行期间的第一个问题。 开始vn.py 1.环境部署完成之后,启动examples/vn_trader/run.py,弹出启动页面。具体搭建过程参考vn.py开发环境搭建(windows)。 image.png 2。连接CTP,点击系统->连接CTP,弹出连接界面。 image.png 3.介绍一下个字段 用户名:在simnow注册的用户名6位数字 密码:登录simnow使用的密码 经纪商代码:9999 交易服务器地址:180.168.146.187:10101 行情服务器地址:180.168.146.187:10111 产品名称:simnow_client_test 授权码:0000000000000000 16个0 4.获取你的用户名和密码 登录http://www.simnow.com.cn/,从右上角的注册账号开始操作,这里就不讲了,大家自己鼓捣吧。 问题来了 所有准备工作做好后,点击连接,这时左下角会显示日志。 image.png 如果你是第一次登陆,那么会提示CTP首次登陆需要修改密码,这也就是我们今天要解决的问题 试图解决 刚看到这个问题觉得没什么,修改一下密码就可以了,但是。。。。。 首先没有再vn.py上找到可以修改密码的地方,后来,也正常人家只是策略平台,也不仅仅是给CTP用, 所以去注册的地方simnow官网找找吧,但是。。。。 很遗憾仍然没有找到,这里不得不吐槽一下simnow了。是不是应该给个改密码的地方? 据说可以使用市场上的交易应用修改密码,大家可以去试试。或者大家有更好的方法也可以回复留言。 开始撸它 好吧,那么我们用程序员的方式来解决这个问题吧。 1.在vnpy/api/ctp目录下可以看到完整ctp开发的api,包括库和头文件。哈哈,是不是会让你产生非分之? 2.我们在ThostFtdcTraderApi.h中发现了我们要的东西 ///用户口令更新请求 virtual int ReqUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, int nRequestID) = 0; 3.找到ctp api文档在simnow官网上可以找到,我这里用的事《综合交易平台TraderAPI接口说明.pdf》 4.开始撸代码吧,我显示在linux开始撸,后来发现我的操作系统编译器版本太低,当然升级版本应该可以解决,但升级gcc,glibc还是相当耗时的。所以后来移植到了windows,但工程还是linux风格,使用cmake构建,好在现在vs对cmake支持的不错。 5.继续撸,先贴一段吧 #include "ctp_trade_handler.h" #include "INIReader.h" #include int main(int argc, char* argv[]) { string a; INIReader reader("../conf/ctp.ini"); if (reader.ParseError() != 0) { std::cout << "Can't load 'test.ini'\n"; return 1; } std::cout << reader.GetInteger("user","BrokerID",9999) << endl; ctp_trade_handle ctp; ctp.CreateFtdcTraderApi(); ctp.RegisterFront("tcp://180.168.146.187:10100"); ctp.init(); //CThostFtdcReqAuthenticateField reqAuthenticate = { 0 }; //strcpy(reqAuthenticate.AppID, "simnow_client_test"); //strcpy(reqAuthenticate.UserID, "158477"); //strcpy(reqAuthenticate.AuthCode, "0000000000000000"); //strcpy(reqAuthenticate.BrokerID, "9999"); //ctp.ReqAuthenticate(&reqAuthenticate, 1); CThostFtdcReqUserLoginField reqUserLogin = { 0 }; strcpy(reqUserLogin.BrokerID,"9999"); strcpy(reqUserLogin.UserID,"158477"); strcpy(reqUserLogin.Password,"qwe123"); ctp.ReqUserLogin(&reqUserLogin, 1); std::cout <> a; CThostFtdcUserPasswordUpdateField reqUserPasswordUpdate = { 0 }; strcpy(reqUserPasswordUpdate.BrokerID, "9999"); strcpy(reqUserPasswordUpdate.UserID, "158477"); strcpy(reqUserPasswordUpdate.OldPassword, "qwe123"); strcpy(reqUserPasswordUpdate.NewPassword, a.c_str()); ctp.ReqUserPasswordUpdate(&reqUserPasswordUpdate, 3); std::cin >> a; ctp.exit(); return 0; } 代码很简单,这里就不多说了。目前只是为了解决我修改密码的需求,后续还会不断完善。 如有需要可以自己取来撸,代码托管地址:https://github.com/FrankXMX/c... 欢迎watch和star 5.使用上就是填写好你的相关信息,编译运行,输入新密码。得到屏幕输出。 6.回到vn.py,使用新密码重新连接ctp。 大功告成!!!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值