PHP移动互联网开发笔记(6)――MySQL数据库基础回顾_MySQL
最近看了一些架构方面的资料,但是发现基础知识都不怎么牢固,接下来的一段时间,我会定期总结基础知识。
一、数据类型
二、MySQL数据库的操作1、整型
数据类型 存储空间 说明 取值范围 TINYINT 1字节 非常小的整数 带符号值:-128~127
无符号值:0~255 SMALLINT 2字节 较小的整数 带符号值:-32768~32767
无符号值:0~65535 MEDIUMNT 3字节 中等大小的整数 带符号值:-8388608~8388607
无符号值:0~16777215 INT 4字节 标准整数 带符号值:-2147483648~2147483647
无符号值:0~4294967295 BIGINT 8字节 大整数2、浮点型
数据类型 存储空间 说明 取值范围 FLOAT 4字节 但精度浮点数 DOUBLE 8字节 双精度浮点数 DECIMAL(M,D) 自定义 以字符串形式表示3、字符串类型
类型 存储空间 说明 最大长度 Char[(M)] M字节 定长字符串 M字节 Varchar[(M)] L+1字节 可变长字符串 M字节 tinyblog,tingtext L+1字节 非常小的blob和文本串 2^8字符 blog,text L+2字节 小BLOB和文本串 2^16-1字节 mediumblob,mediumtext L+3字节 中等的BLOB和文本串 2^24字节 longblob,longtext L+4字节 大BLOB和文本串 2^32-1字节 enum('value','value') 1或2字节 枚举:可赋予某个枚举成员 65535个成员 set('value', 'value') 1,2,3,4或8字节 集合:可赋予多个集合成员 64个成员
4、日期和时间型数据 类型 存储空间 说明 最大长度 Date 3字节 YYYY-MM-DD格式表示 1000-01-01~9999-12-31 TIME 3字节 hh:mm:ss格式表示时间值 -838:59:59~838:59:59 DATETIME 8字节 YYYY-MM-DD hh:mm:ss格式 TIMESTAMP 4字节 YYYYMMDDhhmmss格式表示时间戳 YEAR 1字节 YYYY格式的年份值 1901~2155
1、登录数据库
mysql 参数
-D,--database=name 打开指定数据库
--delimiter=name 指定分隔符
-E,--vertical 垂直显示结果
-h,--host=name 服务器名称
-H,--html 提供HTML输出
-X,--xml 提供XML输出
-p,--password[=name]密码
-P,--port=# 端口号
--prompt=name 设置提示符
-u,--user=name 用户名
-V,--version 输出版本信息并退出
mysql -h 服务器主机地址 -u 用户名 -p 用户密码
2、退出登录
exit
quit
/q
3、修改密码
4、创建选择及查看数据库
创建数据库
选择数据库
删除数据库中的内容

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Of course, sharing mobile internet between an Android smartphone and a Windows 11 PC can be useful, especially when Wi-Fi is unavailable. So it can be very handy to know how to share mobile internet with Windows devices when other options are just emerging. Just like an iPhone can connect to a Mac when Wi-Fi is not available, Android devices allow users to connect their smartphone's Internet connection to any Windows laptop via USB and Bluetooth. For many of us, connecting your phone and PC via cable isn't an option, and connecting to the internet via Bluetooth can be slow. So, use your smartphone to create W

Microsoft users can connect their phones to their PCs using the app Phone Link (formerly Your Phone). This application allows your Windows PC to access photos, texts, notifications, and other data on your phone. Phone Link will be able to mirror the screen of your Android device. Currently, this feature is still in the testing phase for some Samsung smartphones. Users can still connect their Android devices to their PC using a USB cable, however, this only allows users to transfer files, photos, music, and other media between their PC and smartphone. To access texts and calls,

Solution to the problem that the computer mobile hotspot cannot be turned on: 1. Click "This PC->right-click->Manage->Device Manager"; 2. Double-click the device manager, open the network adapter, then right-click to find "Microsoft Wi-Fi" and Just choose to enable the device.
![Can't change Instagram profile picture [Solved]](https://img.php.cn/upload/article/000/465/014/168146430730063.png?x-oss-process=image/resize,m_fill,h_207,w_330)
Some very social Instagram users usually update their profile pictures from time to time. Recently, we noticed that many Instagram users are unable to change their Instagram profile picture. When they try to change with new Instagram profile picture, it throws different error messages like “Unable to change photo”, “Sorry, we cannot update your profile picture. Please confirm that you are connected to the internet later Try again" and so on. There can be several reasons why these errors occur when trying to change your Instagram profile picture, some of which are listed below. Outdated Instagram App Bad Internet Connection Instagram App

Some applications are entitled to be used only by certain users. Therefore, if you are logged into the system using someone else's user account and want to launch the application, you may need to log out of the system and log in using your user account. However, you can launch the application directly by running it as a different user. Once the user runs the application as another user, it will pop up a small window asking the user to enter the credentials of the user account that is required to open the application. Wouldn't that be great? It really saves a lot of time and unnecessary hassle of logging into another user account again. This article will guide you on how to do this easily. How to run any application as different user in Windows 11, 10 Step 1: If the application icon is on the desktop

The new NIO NIO Phone (NIOPhone 2) will be released on July 27. As the release date approaches, on July 24, Bai Jian, Vice President of NIO Technology (Anhui) Co., Ltd., answered two of the most common questions about NIO Phone among netizens. NIOPhone "Why does NIO insist on making mobile phones?" Similar questions appear in almost all comment areas related to the new NIOPhone. Bai Jian responded that Weilai had started thinking and planning about making mobile phones very early, and it was not a whim, let alone as some people said, because some mobile phone brands have started to make cars. Bai Jian broke the news about the new NIOPhone "smart car and mobile phone"

what do you need? In order to change your Slack status from the iOS home screen, you'll need to have the following items ready: An iPhone running iOS 13 or later (required to run the Shortcuts app) The Shortcuts app should be installed Connect the Blueprint app from the App Store Set up the Slack status shortcut How to set up the Set Slack Status shortcut on iOS The Set Slack Status shortcut is a nifty tool when it comes to setting your Slack status instantly. However, the process of setting it up requires more effort than adding the shortcut to your iPhone. You can follow the steps below

Apple's Weather App Now on iPad For years, the iPad never had a native weather app, so users had to download third-party apps from the AppStore. Fortunately, with iPadOS16, Apple is bringing its own Weather app to the iPad. iPhone users may be familiar with this app, but there are still some tricks that not everyone knows. Since Apple acquired DarkSky in 2020, the Weather app on iPhone has received several new features. In iOS15, Apple improved animations for apps while also adding maps and
