安装MySQL #
参考:https://linuxize.com/post/how-to-install-mysql-on-ubuntu-18-04/#installing-mysql-on-ubuntu
命令:sudo apt-get install mysql-server
colin@colin-VirtualBox:~/Downloads$ sudo apt-get install mysql-server
[sudo] colin 的密码:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成
将会同时安装下列软件:
libaio1 libcgi-fast-perl libcgi-pm-perl libevent-core-2.1-7 libevent-pthreads-2.1-7 libfcgi-bin libfcgi-perl libfcgi0ldbl libhtml-template-perl libmecab2 libprotobuf-lite23 mecab-ipadic
mecab-ipadic-utf8 mecab-utils mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server-8.0 mysql-server-core-8.0
建议安装:
libipc-sharedcache-perl mailx tinyca
下列【新】软件包将被安装:
libaio1 libcgi-fast-perl libcgi-pm-perl libevent-core-2.1-7 libevent-pthreads-2.1-7 libfcgi-bin libfcgi-perl libfcgi0ldbl libhtml-template-perl libmecab2 libprotobuf-lite23 mecab-ipadic
mecab-ipadic-utf8 mecab-utils mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server mysql-server-8.0 mysql-server-core-8.0
升级了 0 个软件包,新安装了 20 个软件包,要卸载 0 个软件包,有 40 个软件包未被升级。
需要下载 28.3 MB 的归档。
解压缩后会消耗 240 MB 的额外空间。
您希望继续执行吗? [Y/n] y
done!
update-alternatives: 使用 /var/lib/mecab/dic/ipadic-utf8 来在自动模式中提供 /var/lib/mecab/dic/debian (mecab-dictionary)
正在设置 mysql-server-8.0 (8.0.29-0ubuntu0.22.04.2) ...
update-alternatives: 使用 /etc/mysql/mysql.cnf 来在自动模式中提供 /etc/mysql/my.cnf (my.cnf)
Renaming removed key_buffer and myisam-recover options (if present)
mysqld will log errors to /var/log/mysql/error.log
mysqld is running as pid 8126
Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysql.service.
正在设置 mysql-server (8.0.29-0ubuntu0.22.04.2) ...
正在处理用于 man-db (2.10.2-1) 的触发器 ...
正在处理用于 libc-bin (2.35-0ubuntu3) 的触发器 ...
colin@colin-VirtualBox:~/Downloads$
修改好MySQL的root密码 #
colin@colin-VirtualBox: sudo mysql
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Daibin@8';
mysql> FLUSH PRIVILEGES;
mysql> exit
colin@colin-VirtualBox:~/Downloads$ mysql -uroot -p
Enter password:
mysql> show databases;
colin@colin-VirtualBox:~/Downloads$ sudo mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.29-0ubuntu0.22.04.2 (Ubuntu)
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '123456';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY '123456'' at line 1
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '12345678';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Daibin@8';
Query OK, 0 rows affected (0.01 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
mysql>
mysql>
mysql> exit
Bye
colin@colin-VirtualBox:~/Downloads$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.29-0ubuntu0.22.04.2 (Ubuntu)
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
mysql>
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.01 sec)
mysql>
mysql>
mysql> quit
Bye
colin@colin-VirtualBox:~/Downloads$ mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
colin@colin-VirtualBox:~/Downloads$
解压DTP安装包 #
将DTP安装文件下载到 ~/Downloads/parasoft_dtp_2021.2.0_linux_x64.tar.gz
colin@colin-VirtualBox:~/Downloads$ ll
总用量 1440824
drwxr-xr-x 2 colin colin 4096 5月 22 22:10 ./
drwxr-x--- 18 colin colin 4096 5月 22 22:07 ../
-rw------- 1 colin colin 489 5月 22 22:08 nohup.out
-rw-rw-r-- 1 colin colin 641729973 5月 22 21:58 parasoft_cpptest_professional-2021.2.1-linux.x86_64.tar.gz
-rw-rw-r-- 1 colin colin 833649431 5月 22 22:09 parasoft_dtp_2021.2.0_linux_x64.tar.gz
colin@colin-VirtualBox:~/Downloads$ tar xzf ./parasoft_dtp_2021.2.0_linux_x64.tar.gz
colin@colin-VirtualBox:~/Downloads$ ll
总用量 2266532
drwxr-xr-x 2 colin colin 4096 5月 22 22:24 ./
drwxr-x--- 18 colin colin 4096 5月 22 22:07 ../
-rwxr-xr-x 1 colin colin 56171 10月 8 2021 DTP.sh*
-rwxr-xr-x 1 colin colin 845460932 10月 8 2021 DTP.zip*
-rw------- 1 colin colin 489 5月 22 22:08 nohup.out
-rw-rw-r-- 1 colin colin 641729973 5月 22 21:58 parasoft_cpptest_professional-2021.2.1-linux.x86_64.tar.gz
-rw-rw-r-- 1 colin colin 833649431 5月 22 22:09 parasoft_dtp_2021.2.0_linux_x64.tar.gz
-rwxr-xr-x 1 colin colin 12 10月 8 2021 README.txt*
colin@colin-VirtualBox:~/Downloads$
安装DTP #
命令:colin@colin-VirtualBox:~/Downloads$ ./DTP.sh -i /home/colin/parasoft/dtp -d /home/colin/parasoft/dtp_data
指定安装目录:-i /home/colin/parasoft/dtp
指定数据目录:-d /home/colin/parasoft/dtp_data
colin@colin-VirtualBox:~/Downloads$ ll
总用量 2275248
drwxr-xr-x 2 colin colin 4096 5月 22 22:28 ./
drwxr-x--- 19 colin colin 4096 5月 22 22:28 ../
-rwxr-xr-x 1 colin colin 56171 10月 8 2021 DTP.sh*
-rwxr-xr-x 1 colin colin 845460932 10月 8 2021 DTP.zip*
-rw-rw-r-- 1 colin colin 8918269 5月 22 22:28 install22-05-22_22_27_46.log
-rw------- 1 colin colin 489 5月 22 22:08 nohup.out
-rw-rw-r-- 1 colin colin 641729973 5月 22 21:58 parasoft_cpptest_professional-2021.2.1-linux.x86_64.tar.gz
-rw-rw-r-- 1 colin colin 833649431 5月 22 22:09 parasoft_dtp_2021.2.0_linux_x64.tar.gz
-rwxr-xr-x 1 colin colin 12 10月 8 2021 README.txt*
colin@colin-VirtualBox:~/Downloads$
colin@colin-VirtualBox:~/Downloads$ ./DTP.sh
Parasoft DTP Installer
Copyright (C) by Parasoft Corporation.
Installer version:
DTP 2021.2.0
Usage: ./DTP.sh [-i|-u -d ]
OPTIONS:
-h, --help Prints this help
-i, --install [directory] Install DTP in specified directory
-u, --update [directory] Update DTP in specified directory
-d, --data_dir [directory] Setup DTP data directory in specified directory
Examples:
'./DTP.sh -i /home/usr/dtp -d /home/usr/dtp_data'
'./DTP.sh -u /home/usr/dtp -d /home/usr/dtp_data'
colin@colin-VirtualBox:~/Downloads$ ./DTP.sh -i /home/colin/parasoft/dtp -d /home/colin/parasoft/dtp_data
colin@colin-VirtualBox:~/Downloads$
安装DTP的MySQL JDBC包 #
查看MySQL的版本,本例子为8.0.29。
colin@colin-VirtualBox:~/Downloads$ mysql --version
mysql Ver 8.0.29-0ubuntu0.22.04.2 for Linux on x86_64 ((Ubuntu))
下载MySQL Connector的deb包,版本选择跟MySQL一样的版本。使用命令下载安装包,或者通过浏览器从网上下载。
命令下载:
colin@colin-VirtualBox:~/Downloads$ wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java_8.0.29-1ubuntu21.10_all.deb
colin@colin-VirtualBox:~/Downloads$ wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java_8.0.29-1ubuntu21.10_all.deb
--2022-05-22 23:33:37-- https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java_8.0.29-1ubuntu21.10_all.deb
正在解析主机 dev.mysql.com (dev.mysql.com)... 137.254.60.11
正在连接 dev.mysql.com (dev.mysql.com)|137.254.60.11|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 302 Found
位置:https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java_8.0.29-1ubuntu21.10_all.deb [跟随至新的 URL]
--2022-05-22 23:33:39-- https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java_8.0.29-1ubuntu21.10_all.deb
正在解析主机 cdn.mysql.com (cdn.mysql.com)... 223.119.236.209
正在连接 cdn.mysql.com (cdn.mysql.com)|223.119.236.209|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度: 2475834 (2.4M) [application/x-debian-package]
正在保存至: ‘mysql-connector-java_8.0.29-1ubuntu21.10_all.deb’
mysql-connector-java_8.0.29-1u 100%[====================================================>] 2.36M 2.71MB/s 用时 0.9s
2022-05-22 23:33:40 (2.71 MB/s) - 已保存 ‘mysql-connector-java_8.0.29-1ubuntu21.10_all.deb’ [2475834/2475834])
colin@colin-VirtualBox:~/Downloads$
浏览器下载:https://dev.mysql.com/downloads/connector/j/
安装MySQL Connector JDBC包,并拷贝到DTP数据目录“/home/colin/parasoft/dtp_data/lib/thirdparty/”下。
命令:
sudo dpkg -i ./mysql-connector-java_8.0.29-1ubuntu21.10_all.deb
cp /usr/share/java/mysql-connector-java-8.0.29.jar /home/colin/parasoft/dtp_data/lib/thirdparty/
colin@colin-VirtualBox:~/Downloads$ sudo dpkg -i ./mysql-connector-java_8.0.29-1ubuntu21.10_all.deb
正在选中未选择的软件包 mysql-connector-java。
(正在读取数据库 ... 系统当前共安装有 180632 个文件和目录。)
准备解压 .../mysql-connector-java_8.0.29-1ubuntu21.10_all.deb ...
正在解压 mysql-connector-java (8.0.29-1ubuntu21.10) ...
正在设置 mysql-connector-java (8.0.29-1ubuntu21.10) ...
colin@colin-VirtualBox:~/Downloads$
colin@colin-VirtualBox:~/Downloads$ cp /usr/share/java/mysql-connector-java-8.0.29.jar /home/colin/parasoft/dtp_data/lib/thirdparty/
colin@colin-VirtualBox:~/Downloads$ ll /home/colin/parasoft/dtp_data/lib/thirdparty/
总用量 2472
drwxr-xr-x 2 colin colin 4096 5月 22 23:50 ./
drwxr-xr-x 3 colin colin 4096 5月 22 22:28 ../
-rw-r--r-- 1 colin colin 2519528 5月 22 23:50 mysql-connector-java-8.0.29.jar
colin@colin-VirtualBox:~/Downloads$
配置DTP #
执行命令取得DTP的机器码,发给Parasoft的工程师获取秘钥。
/home/colin/parasoft/dtp/bin/dtpconsole.sh
colin@colin-VirtualBox:~/Downloads$ /home/colin/parasoft/dtp/bin/dtpconsole.sh
配置并初始化数据库结构,选(5)database configuration
启动DTP #
执行命令来启动DTP:/home/colin/parasoft/dtp/bin/dtpconsole.sh
分别选择启动 3个服务:
(1) DTP Server (Report Center, Team Server, License Server)
(2) Data Collector
(3) DTP Enterprise Pack
从浏览器访问DTP:http://localhost:8080/
登录密码:admin/admin
将秘钥填入所示框中,点击“设置许可证”即完成了DTP的安装。
DTP 2021.2
Tool : DTP 5.5
Features : DTP, DTP Azure DevOps Integration, DTP Enterprise,
DTP Jama Connect Integration, DTP Jira Integration,
DTP License Server, DTP License Server borrowing,
DTP Machine Learning, DTP No Engine,
DTP Polarion Integration, DTP Team Server,
DTP TeamForge Integration, DTP VersionOne Integration,
DTP codeBeamer Integration
"Machine id" value : LINUX2-0f41c000
Date of expiration : 7995548
(Jun 5, 2022)
Password : PARASOFT_732DAD727ACF9E0A82F434964D2051429994971B02971CA846C36D036A504A01A0F906EAC2F9025F82834978B1FA61EF24D75DDED902B8856C19221E4EE5588B_16AC92A0222D74B2ECFA18661ED39B389987613BED91EC401D27FA2F81CA018E66294B9AE2D432283AF07841FFC28AADE9EAFE908F549E452C77AE1313754BB7
(1 user, Ordinary License)
For Parasoft License Server or loading from local file:
DTP.Password 5.5 LINUX2-0f41c000 7995548 PARASOFT_732DAD727ACF9E0A82F434964D2051429994971B02971CA846C36D036A504A01A0F906EAC2F9025F82834978B1FA61EF24D75DDED902B8856C19221E4EE5588B_16AC92A0222D74B2ECFA18661ED39B389987613BED91EC401D27FA2F81CA018E66294B9AE2D432283AF07841FFC28AADE9EAFE908F549E452C77AE1313754BB7