关于克隆机器引起的tomcat无法启动和mysql不能访问的排查
2016-06-10 13:54
483 查看
在一次生产下克隆服务器到测试环境过程中,发现克隆后相关网络配置等都修改为测试环境,但死活出现tomcat启动后报如下错误:
严重: StandardServer.await: create[localhost:8021]:
通过排查发现/etc/hosts中绑定的是原来的IP地址,修改为测试地址后,启动正常。
service mysqld stop
mysqld_safe --skip-grant-tables --skip-networking &
mysql -p
update mysql.user set authentication_string=password('UYmi@191') where user='root' and Host = 'localhost';
flush privileges;
quit;
service mysqld restart
mysql -u -p
如以上修改密码为弱密码,则执行此命令修改为强密码alter user 'root'@'localhost' identified by 'UYmi@191';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'UYmi@191' WITH GRANT OPTION;
flush privileges;
严重: StandardServer.await: create[localhost:8021]:
通过排查发现/etc/hosts中绑定的是原来的IP地址,修改为测试地址后,启动正常。
Tomcat在启动时,会根据配置去获取所有的IP地址,并且进行逐个绑定,当发现需要绑定的IP地址不存在时,将会触发上述异常,从而导致无法正常启动。另外mysql出现本机密码登陆上去不对,非常奇怪,可采取如下方式处理:
service mysqld stop
mysqld_safe --skip-grant-tables --skip-networking &
mysql -p
update mysql.user set authentication_string=password('UYmi@191') where user='root' and Host = 'localhost';
flush privileges;
quit;
service mysqld restart
mysql -u -p
如以上修改密码为弱密码,则执行此命令修改为强密码alter user 'root'@'localhost' identified by 'UYmi@191';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'UYmi@191' WITH GRANT OPTION;
flush privileges;
相关文章推荐
- MySQL中的integer 数据类型
- java-模拟tomcat服务器
- MySQL存储过程
- i-jetty环境搭配与编译
- 实现单Tomcat多Server配置
- 生产环境下的Tomcat配置
- mysql中int、bigint、smallint 和 tinyint的区别与长度
- mysql load data 导出、导入 csv
- source命令执行SQL脚本文件
- MySQL创建用户及权限控制
- Linux部署Tomcat服务器
- MySQL管理数据表
- linux下mysql添加用户
- mysql procedure
- mysql触发器
- XP下使用虚拟机安装配置Solaris[多图]
- jenkins------结合maven将svn项目自动部署到tomcat下
- 如何搞定tomcat这只喵~
- VirtualBox虚拟机XP与宿主机Ubuntu互访共享文件夹