转自:https://blog.csdn.net/liumengyan_ysu/article/details/44224735
https://www.jb51.net/article/100413.htm
今天想使用一个方便的mysql管理工具,曾经在windows下使用过navicat,觉得还不错,和plsqldeveloper差不多。
网上果然找到了
同时还有安装方法
1,官方下载最新版
2,下载后 解压tar文件
tar -zxvf navicat100_mysql_en.tar.gz3,解压后进入解压后的目录运行
./start_navicat
即可成功运行
但是连接上数据库后里面的中文数据是乱码,找了下原因,把ubuntu的字符集修改为zh_CN.utf8就行了,修改方法:
1,查看系统支持的字符集
locale -a
结果:
feng@feng:~$ locale -a
C
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZW.utf8
POSIX
zh_CN.utf8
zh_HK.utf8
zh_SG.utf8
zh_TW.utf82,修改字符集
export LANG=zh_CN.utf8破解
在这里需要强调下,注册码都是在windows下的,ubuntu中无法使用,教大家一个方法
—第一次执行start_navicat时,会在用户主目录下生成一个名为.navicat的隐藏文件夹。
—-此文件夹下有一个system.reg文件
—-把此文件删除后,下次启动navicat 会重新生成此文件,30天试用期会按新的时间开始计算。
—-将就着用了
我倒是没有遇到字符集问题
关于破解,手动删除太麻烦了,就写了个启动的脚本,启动前先删掉system.reg文件。
删除后,再次启动navicat时,会加载wine的更新配置窗口,启动后之前用的连接名以及密码已经没有了,需要重新创建连接。
原本以为程序运行需要依赖终端,但我关掉终端后,仍然运行良好!很是惊讶,有时间查查原因
---------------开机自动执行脚本---------------------------
rc.local脚本
rc.local脚本是一个ubuntu开机后会自动执行的脚本,我们可以在该脚本内添加命令行指令。该脚本位于/etc/路径下,需要root权限才能修改。
该脚本具体格式如下:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
注意: 一定要将命令添加在 exit 0之前
如何给ubuntu添加一个开机启动脚本
1,新建个脚本文件new_service.sh
#!/bin/bash
# command content
exit 0
2,设置权限
sudo chmod 755 new_service.sh
3,把脚本放置到启动目录下
sudo mv new_service.sh /etc/init.d/
4,将脚本添加到启动脚本
执行如下指令,在这里90表明一个优先级,越高表示执行的越晚
cd /etc/init.d/
sudo update-rc.d new_service.sh defaults 90
移除Ubuntu开机脚本
sudo update-rc.d -f new_service.sh remove