我正在尝试创建一个批处理脚本,它将在执行时创建一个数据库。如果数据库已经存在,脚本应该回显它已经存在。我让它在Linux上运行,但它在Windows上显然有很大不同。
下面是脚本:
@echo off
SET dbname=1234
SET user=1234
SET password=1234
SET hostinfo=test3
SET RESULT="mysql -u root -ppassword --skip-column-names -e SHOW DATABASES LIKE '%dbname%'"
if %RESULT% == "%db
如何在ubuntu终端上抑制警告信息,我目前正在收到:
Warning: Using a password on the command line interface can be insecure. message.
我试着用:
2>/dev/null | grep -v "Using a password on the command line interface can be insecure"
但它抑制了各种错误。请帮帮忙。
我正在尝试设置卡迈利奥与MySQL插件。我按如下方式设置配置:
## your SIP domain
SIP_DOMAIN=example.org
DBENGINE=MYSQL
## database host
DBHOST=localhost
## database host
DBPORT=3306
当我运行kamdbctl create时,我得到以下结果:
INFO: test server charset
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 10
一段时间后,我想从一个shell脚本中执行一个MySQL查询。我已经编写了脚本,但是输出并不像预期的那样。它将再次从数据库中打印相同的值。有人能帮忙吗。
脚本- demo.sh
#!/bin/bash
echo "Shell Script to Query a Database!"
echo "--Querying from the Database starts--"
cd "C:\Program Files\MySQL\MySQL Server 5.7\bin"
for i in {1..5};
do
./mysql -u root -pr
下面是怎么回事?为什么mysql不让我进去?我使用的是5.6
root@ip-10-93-145-98:/home/ubuntu# echo "grant all privileges on *.* to 'really'@'%' identified by 'stupid';" | mysql -u root -ptest101
Warning: Using a password on the command line interface can be insecure.
root@ip-10-93-145-98:/home/u
当我尝试通过命令行连接到远程MYSQL数据库时,尽管出现以下警告,但工作正常:
/sdzf => mysql -h db3 -u auser -ppassword DB_6 -A
Warning: Using a password on the command line interface can be insecure.
但是,运行脚本不起作用
/sdzf => mysql -h db3 -u auser -ppassword DB_6 -A< findrec.sql
Warning: Using a password on the command line inter
我目前正在通过bash运行mysql。但是,它返回错误:
Using a password on the command line interface can be insecure.
实现这一目标的安全方法是什么?在没有警告的情况下,我如何正确地调用mysql?
#!/bin/bash/
user=test
password=test
database=test
mysql --user='$user' --password='$password' --database='$database' --execute='DROP DATA
我加了这一行
#mysql password
alias mysql='mysql -umilenko -p*myrealpass*** -hlocalhost'
不管怎样,它不起作用
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'milenko'@'localhost' (using password: YES)
也是
mysql -u roo
如何修复此错误:
# cat <<EOF | mysql -uroot -p${MYSQL_PASSWD}
> create database zabbix character set utf8 collate utf8_bin; create user zabbix@localhost identified by '${ZABBIX_PASSWD}';
> grant all privileges on zabbix.* to '\'zabbix'\'@'\'localhost'\'
当我直接执行以下命令时: root@busybox-694d76bb5d-2gcvh:/# mysql -hmariadb -P3306 -uroot -ppassword -e 'SELECT 1' 我得到以下输出: mysql: [Warning] Using a password on the command line interface can be insecure.
+---+
| 1 |
+---+
| 1 |
+---+ 但是,子subshell中的相同命令如下所示: $(mysql -hmariadb -P3306 -uroot -ppassword -e
如果我在两个不同的语句中在MySQL (从官方的MySQL Dokcer派生而来)期间启动MySQL服务器,那么数据库文件会被接受吗?
我会说是的,但这似乎是错误的。为什么?
日志文件:
180228 08:54:50 mysqld_safe Logging to '/var/lib/mysql/c2712433a4da.err'.
180228 08:54:50 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
mysql: [Warning] Using a password on t
我想要更改mysql docker容器的默认公开端口,但如果我尝试使用以下命令:
docker run --detach --name=test-mysql -p 52000:52000 --env="MYSQL_ROOT_PASSWORD=mypassword" mysql
它不起作用。mysql -uroot -pmypassword -h 127.0.0.1 -P 52000 Warning: Using a password on the command line interface can be insecure. ERROR 2013 (HY000): Lost
C:\Users\dp\Desktop>mysql -u user -pXXXX -h 127.0.0.1 -P 3306
Warning: Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'mywayuser'@'localhost' (using passwo
rd: YES)
C:\Users\dp\Desktop>mysql -u user -pXXXX -h localhos
"Warning: Using a password on the command line interface can be insecure.?ERROR 1031 (HY000) at line 12943: Table storage engine for 'ims_ewei_shop_abonus_billo' doesn't have this option?dumper err?"("-17")
我正在尝试启用主从之间的复制来执行单向复制。我必须创建MySQL语句并在命令中替换密码,以便用Jenkins凭据掩盖密码。
我的MySQL实例是Amazon。问题是,在我实现sed之前,当我在本地测试时,我的密码只是硬编码在命令中,没有问题,所以我想我只是在没有看到的地方搞错了一些语法。
MySQL版本: MySQL 5.7.19
当我对密码进行硬编码时,这个方法就奏效了。我不知道我是什么
这是运行命令的Jenkins作业的输出。输出:
16:55:48 ==================== Create Replication User and Grant Permissions on
我使用mysql客户端从dataproc的主节点登录mysql服务器,现在它失败了。
使用以下命令
mysql -uroot -p<password>
我现在看到以下错误消息。
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
在我的AWS Linux中,我想创建一个EC2作业来自动备份AWS RDS中的MySql数据库。我试着逃走
/usr/bin/mysqldump -u dbusername -p'dbpassword' dbname > /path/backup.sql
但是我得到了一个错误
"Warning: Using a password on the command line interface can be insecure.
mysqldump: Got error: 1045: Access denied for user 'dbusername'@
当我在提示符中输入时
mysql -u root -p;
提示符会返回以下内容:
mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
我该如何解决这个问题呢?谢谢兄弟们!
在设置容器时,我在终端中遇到此错误。
最终,数据库会初始化:
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Initialized Database
但是,我无法从root用户访问它,这让我认为容器不能正常工作。
通过Git Bash2.5(通过本地主机上的Windows )连接到MySQL时,我遇到了一个非常烦人的问题。通过CMD和Mysysgit,一切工作正常。
$ mysql -u root -proot Warning: Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 5.6.26-log MySQL Commu
Hi当我尝试连接远程mysql时
mysql -u root -p xxxx -h xxxx -P 80
mysql: [Warning] Using a password on the command line interface can be insecure.
然后我就挂在这里
有人知道如何解决这个问题吗?
我在这里尝试的是,我希望将mysql查询和该查询的输出保存在一个文件中,并在ubuntu终端上显示。我的方法是这样的:
$ mysql -u user -pmysql |& tee day1.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
use AUDIT;
select * from CUSTOMERS;
但是,直到我按下ctrl + D.It键,它才会显示输出,似乎它会将我的查询发送给mysql服务器,我也希望看到终端中的查询输出,有什么方法可以做到吗?
我想使用以下语法创建一个数据库
mysql -u<uname> -p<password> -e "create database <name>"
但每当我尝试使用点(.)在数据库名中,它会给我带来错误。
[root@aee9a1889c3f wpg.master]# mysql -uroot -proot -e "create database 'a.n'"
Warning: Using a password on the command line interface can be insecure.
ERRO
我这里有个奇怪的错误。我正在执行的命令如下:
mysqldump -u root -ppass kodi_video119 | mysql -h192.168.178.73 -u kodi -ppass kodi_video119
当我在SSH上执行它时,一切正常,但是当我将它保存到一个文件并执行这个文件时,会得到以下错误:
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command li
我正在使用MySQL5.6,我想从bash连接mysql。
mysql -u根-pAdmin@1234
我在跟踪错误-
Warning: Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
但如果我用-
mysql -u根-p
手动提供密码,然后它就能工作了。有人能帮我解决这个问题吗。
-bash-4.2$ mysql -u root -pmypassword
Warning: Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
密码是正确的,如果我使用
-bash-4.4$ mysql -u root -p
使用相同的密码可以登录
警告消息是好的,但它必须允许我登录,如果我在命令行给出密码?
我想用shell命令连接到外部服务器上的mysql数据库。Ubuntu版本16.04。
mysql -uXXXXXX -pYYYYYY -h domain.com
我得到了错误:
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2059 (HY000): Authentication plugin 'mysql_old_password' cannot be loaded: /usr/lib/mysql/plugin/mysql_old_passwor
我在AWS上使用MySQL 8.0.16。当我运行SQL命令时:
mysql> LOAD DATA INFILE 't1.csv' INTO TABLE t1 FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';
ERROR 1045 (28000): Access denied for user 'admin'@'%' (using password: YES)
从Shell运行mysqlimport
我不想在crontab创建的日志文件中保存“警告”日志,我只想要“错误”消息,有人知道我如何排除这些消息吗?我尝试过使用grep -v,但它不起作用:
45 5 * * * /home/username/barc/backupsql.sh 2>&1 | grep -v 'Warning: Using a password on the command line interface can be insecure.'
谢谢你能帮我。
#!/bin/bash
date +'%F %T'
echo "Show Database"
mysql -u [user] -p[password] -e 'SHOW DATABASES,USE eventime,SELECT * FROM dt;'
输出:
2016-09-22 16:01:33
Show Database
Warning: Using a password on the command line interface can be insecure.
ERROR 1064 (42000) at line 1: You have
我用Python编写了这个小脚本,以便从数据库创建表的备份:
import subprocess
sql_cmd = 'mysql -B -u User -pPassword -e Database "SELECT * FROMdevice;" > file.csv'
subprocess.run([sql_cmd], shell=True)
它正在工作,但我收到了这样的警告消息:mysql: [Warning] Using a password on the command line interface can be insecure.
如果可能,我想
我有一个后端服务器,它响应我的客户端应用程序,每秒有超过20k~25k的点击量,这使得我的服务器负载平均很高,我认为我的MySQL配置不合适。
此外,我们的后端系统还附带了自己的缓存系统,但是有些查询无法缓存,而且我的数据库有26个表(全部使用InnoDB引擎),其中最大的表大约有60万行。
My Server Spec
Processor Name Common KVM processor
Vendor ID GenuineIntel
CPU Core: DualCore + 2 thread core
Processor Speed (MHz) 3192.746
Total Me
我需要上传我的本地.sql转储到我的heroku机器。我使用的是MySQL db和插件ClearDB。
我试过这样的命令:
mysql --host=us-cdbr-east.cleardb.com --user=MY_USER --password=MY_PASSWORD --reconnect heroku_xxxxxxxxxxxx < test.sql
但我得到这个错误作为回应:
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2026 (HY000):
我使用bash中的查询命令,它返回一个数字。然而,它被打印成一张桌子。
$ mysql -u muser -p$PASS mm -e "SELECT.....;"
mysql: [Warning] Using a password on the command line interface can be insecure.
+----------------------------+
| COUNT(DISTINCT ula.userid) |
+----------------------------+
| 29 |
+---
当我在mysql脚本中使用下面的命令使用mysql时,
mysql -uUserName -pPassWord DBName
我收到以下警告
Warning: Using a password on the command line interface can be insecure.
我的should脚本正在循环中运行这个命令,以便在我的表中插入一些数据,所以它在屏幕上连续地发出警告,这使得输出非常笨拙,那么我应该如何停止从mysql打印这个警告呢?
在bash中,我们要执行以下逻辑:如果变量"$SLACK"是TRUE,而${OUTPUT}不等于"mysql: [Warning] Using a password on the command line interface can be insecure",则调用slack_it函数。
我已经尝试过从这里的帖子( , )中提供了十几种解决方案,但没有一种有效。有什么大师能启发我们吗?
#!/bin/bash
if [ "$SLACK" == "TRUE" ]
then
if ! [[ ${OUTPUT}
在我的本地计算机上,我可以使用mysql cli命令轻松地连接到mysql数据库的远程实例(假设设置了环境变量):
# mysql -u root -p$DB_PASSWORD -h $DB_HOST --port=$DB_PORT
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7365
Server ver