前言
都2025年了還在自學JAVA后臺開發?作為一個iOS、Android、前端開發的我為了全棧之路,開干!?。?br> 擁有Android開發的JAVA基礎相信學習起來并不困難。
學習網站研究
JDK安裝: https://www.oracle.com/cn/java/technologies/downloads/#jdk17-windows
IntelliJ Idea安裝: https://www.jetbrains.com.cn/idea/
maven: https://maven.apache.org/download.cgi
SpringBoot: https://spring.io/
Tomcat: https://tomcat.apache.org/
https://mybatis.org/mybatis-3/zh_CN/index.html
MYSQL: https://downloads.mysql.com/archives/community/
JAVA入門的學習
學習視頻(免費): 含Java項目和java真題
- 擁有Android開發的JAVA基礎直接跳過JAVA教程,進入數據庫的學習
MYSQL的學習
教程: http://www.codebaoku.com/it-db/it-db-20246.html
設置環境變量:MYSQL_HOME(安裝目錄)和新建path(%MYSQL_HOME%\bin)
命令行:
1:mysql
顯示:ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost:3306' (10061)
2:mysqld --initialize-insecure
在MySQL安裝目錄會生成一個文件夾data
3: mysqld -install
電腦搜索服務,進入服務看到MySql服務(開機自啟動)
4:net start mysql
顯示:
MySQL 服務正在啟動 ..
MySQL 服務已經啟動成功。
5:net stop mysql
顯示:
MySQL 服務正在停止.
MySQL 服務已成功停止。
6: 修改默認賬號密碼
mysqladmin -u root password 123456
顯示:
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
7:登錄MySQL(mysql -h【主機地址】 -u【用戶名】 -p【密碼】)
mysql -uroot -p123456 或 mysql -uroot -p(按回車輸入密碼)
顯示:
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.31 MySQL Community Server - GPL
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.
8: 退出
exit
9: 退出數據庫和停止 MySQL 服務
quit
創建數據庫
10:create database db01; create database db02; create database if not exists db03;
顯示所有數據庫
11:show databases;
使用數據庫
12:use db01;
查看當前使用的數據庫
13: select database();
刪除數據庫
14:drop database db03;
-- 創建數據庫
create database db01;
create database db02;
create database if not exists db03;
-- 顯示所有數據庫
show databases;
-- 使用數據庫
use db01;
-- 查看當前使用的數據庫
select database();
-- 刪除數據庫
drop database db03;
/*
create table 表名(
字段1 數據類型 [comment 字段1注釋],
......
字段n 數據類型 [comment 字段n注釋]
) [comment 表注釋]
*/
create table tb_user_default (
id int comment 'ID,唯一標識',
username varchar(20) comment '用戶名',
name varchar(10) comment '姓名',
age int comment '年齡',
gender char(10) comment '性別'
) comment '用戶表';
create table tb_user (
id int primary key comment 'ID,唯一標識',
username varchar(20) not null comment '用戶名',
name varchar(10) not null comment '姓名',
age int comment '年齡',
gender char(10) default '男' comment '性別'
) comment '用戶表';
-- 刪除表
drop table tb_user_default;
drop table td_user;
Javaweb開發學習
學習視頻(免費): 涵蓋Spring+MyBatis+SpringMVC+SpringBoot等
- 目前剛學到Mybatis入門