于一 发表于 2018-10-9 09:02:59

防止人为误操作MySql数据库

# alias mysql='mysql -U'      修改别名临时生效  
# mysql -uroot -p -hlocalhost
  

  
mysql> UPDATE mydb.test SET name='gongli';
  
    ERROR 1175 (HY000): You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
  
mysql> \q
  

  
# echo "alias mysql='mysql -U'" >>/etc/profile    配置别名永久生效
  
# ./etc/profile
  
# tail -1 /etc/profile
  
alias mysql='mysql -U'


页: [1]
查看完整版本: 防止人为误操作MySql数据库