Linux使用命令

一、安装JDK出现错误

  1. If you did this already, delete the swap file "/etc/.profile.sw p" to avoid this message.

    解决:使用命令rm -f /etc/.profile.swp ,再次输入vim /etc/profile

  2. 输入java -version查看java 的jdk版本,出现not command ...

    解决:输入 sudo shutdown -r now,再次查看

  3. Linux 执行Tomcat 的.sh 文件出现“Permission denied”

    解决:输入 chmod u+x *.sh

二、安装mysql出现错误

  1. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES/NO)

    1.停止mysql数据库

    /etc/init.d/mysqld stop (或者直接 kill -9 [PID] 杀进程!)

    2.执行如下命令

    mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

    3.使用root登录mysql数据库

    mysql -u root mysql

    4.更新root密码

    mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';

    最新版MySQL请采用如下SQL:

    mysql> UPDATE user SET authentication_string=PASSWORD('newpassword') where USER='root';

    5.刷新权限

    mysql> FLUSH PRIVILEGES;

    6.退出mysql

    mysql> quit

    7.重启mysql

    /etc/init.d/mysqld restart

     

    8.使用root用户重新登录mysql

    mysql -uroot -p Enter password: <输入新设的密码newpassword>

三、启动tomcat出现Permission Deny

 用命令chmod 修改一下bin目录下的.sh权限就可以了

进入 bin 目录,然后 chmod u+x *.sh

四、启动tomcat出现:Cannot find tomcat/bin/setclasspath.sh This file is needed to run this program

输入命令:unset CATALINA_HOME
再次执行启动程序就可以了。
 
posted @   湘summer  阅读(49)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
点击右上角即可分享
微信分享提示