https://www.itread01.com/content/1550450725.html
InfluxDB Create User
influx
create user admin with password 'admin'
grant all privileges to admin
set password for admin = 'admin'
drop user admin
revoke all on mydb from admin
show grants for admin
External Access
Edit C:\temp\influxdb-1.7.9-1\influxdb.conf so that
auth-enabled = true
NSSM
nssm install
C:\temp\influxdb-1.7.9-1\influxd.exe
C:\temp\influxdb-1.7.9-1\
-config "C:\temp\influxdb-1.7.9-1\influxdb.conf"
InfluxDB
CLI
influx -username admin -password admin
or
influx
auth
admin
admin
End
2020年1月20日 星期一
2020年1月17日 星期五
Visual Studio C++ std::string std::wstring utf8 UTF-8
Using (MT5)
// convert UTF-8 string to wstring
std::wstring utf8_to_wstring (const std::string& str)
{
std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv;
return myconv.from_bytes(str);
}
// convert wstring to UTF-8 string
std::string wstring_to_utf8 (const std::wstring& str)
{
std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv;
return myconv.to_bytes(str);
}
CHAR 936 to UTF8 (MT4)
https://blog.csdn.net/WU9797/article/details/96124105
std::string GBToUTF8Ex(const char *input) {
if (!input || strlen(input) < 1)
return "";
std::stringstream ss;
int len = MultiByteToWideChar(936, 0, input, -1, NULL, 0);
wchar_t *wstr = new wchar_t[len + 1];
memset(wstr, 0, len + 1);
MultiByteToWideChar(936, 0, input, -1, wstr, len);
len = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL);
char *str = new char[len + 1];
memset(str, 0, len + 1);
WideCharToMultiByte(CP_UTF8, 0, wstr, -1, str, len, NULL, NULL);
ss << str;
delete[]wstr;
delete[]str;
return ss.str();
}
Someone's method does not work for me
inline std::string charsetToUtf8String(const std::string & string) {
int wchars_num = MultiByteToWideChar(936, 0, string.c_str(), -1, NULL, 0);
std::wstring wResult(wchars_num, ' ');
// charset 936 = Chinese Simplified (GB2312)
MultiByteToWideChar(936, 0, string.c_str(), -1, &wResult[0], wchars_num);
return toString(wResult);
}
inline std::string toString(const std::wstring & wstring) {
return utility::conversions::utf16_to_utf8(wstring);
}
2020年1月8日 星期三
Change or move MongoDB 4.0 data folder on Windows 10
In 2019, a typical MongoDB 4.0 installs with data folder at C:\Program Files\MongoDB\Server\4.0\data with a service.
How to move \data to another bigger drive, say D drive?
1. services.msc, stop MongoDB service
2. Move all files from C:\Program Files\MongoDB\Server\4.0\data to D:\Program Files\MongoDB\Server\4.0\data
3. Edit C:\Program Files\MongoDB\Server\4.0\bin\mongod.cfg so that its dbPath starts a D: instead of C:
storage:
dbPath: D:\Program Files\MongoDB\Server\4.0\data
journal:
enabled: true
4. admin cmd.exe, run below
C:\Program Files\MongoDB\Server\4.0\bin>mongod --config "C:\Program Files\MongoD
B\Server\4.0\bin\mongod.cfg" --install
5. services.msc, start MongoDB service
Done!
How to move \data to another bigger drive, say D drive?
1. services.msc, stop MongoDB service
2. Move all files from C:\Program Files\MongoDB\Server\4.0\data to D:\Program Files\MongoDB\Server\4.0\data
3. Edit C:\Program Files\MongoDB\Server\4.0\bin\mongod.cfg so that its dbPath starts a D: instead of C:
storage:
dbPath: D:\Program Files\MongoDB\Server\4.0\data
journal:
enabled: true
4. admin cmd.exe, run below
C:\Program Files\MongoDB\Server\4.0\bin>mongod --config "C:\Program Files\MongoD
B\Server\4.0\bin\mongod.cfg" --install
5. services.msc, start MongoDB service
Done!
訂閱:
意見 (Atom)
2007 to 2023 HP and Dell Servers Comparison
HP Gen5 to Gen11 using ChatGPT HP ProLiant Gen Active Years CPU Socket Popular HP CPUs Cores Base Clock Max RAM Capacity Comparable Dell ...
-
On CentOS 7, using yum install gives you cmake version 2.8.11 [root@thrift1 ~]# cat /etc/*release CentOS Linux release 7.2.1511 (Core) ...
-
Synology DSM 5.2 on Virtual Box Files On my Google Drive "2016DSM5.2" or download link below (3 files total: pat, iso, exe) ...
-
Static ZeroMQ (difficult setup) cd /d C:\ mkdir Repos cd /d C:\Repos\ git clone https://github.com/Microsoft/vcpkg cd /d C:\Repos\v...