Mysql数据库
文章平均质量分 50
IT独白者
这个作者很懒,什么都没留下…
展开
-
命令行下mysql
登陆mysql打cmd命令终端,如果已经添加了mysql的环境变量,可以直接使用命令mysql -uroot 直接回车,之后按提示输入密码,如果未添加mysql的环境变量,可以切换到mysql的安装目录下的bin目录,再使用mysq -uroot你也可以手动为mysql添加环境变量。这里就不介绍怎么添加环境变量的方法了密码输入正确转载 2015-06-21 13:06:46 · 602 阅读 · 0 评论 -
数据库中不支持中文,将默认的gbk格式调整成utf-8格式
之前lz在用scrapy对链家进行爬取的时候,将数据保存到mysql数据库中,发现如果不修改字符集的格式,那么默认就是gbk,就会不支持中文,那么就需要将其更改为utf-8的格式。这就需要在mysql创建表的时候,将默认的字符格式指定为utf-8格式,有助于对中文的支持。具体的执行如下所示:create table music_review_douban ( id int auto_i原创 2017-10-31 15:53:55 · 1960 阅读 · 0 评论 -
Mac(OS X)安装、配置并使用MySQL数据库
1、MySQL安装包下载MySQL Community Server下载地址:http://dev.mysql.com/downloads/mysql/,下载完毕之后安装文件如下所示:2、MySQL安装双击安装文件进行安装,出现如下界面:双击窗体中的“mysql-5.7.10-osx10.9-x86_64.pk转载 2017-10-31 15:48:17 · 1853 阅读 · 2 评论 -
Database LeetCode Rank Scores
题目:Write a SQL query to rank scores. If there is a tie between two scores, both should have the same ranking. Note that after a tie, the next ranking number should be the next consecutive integer va原创 2016-02-20 14:12:27 · 480 阅读 · 0 评论 -
Database LeetCode Department Highest Salary
题目:The Employee table holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id.+----+-------+--------+--------------+| Id | Name | Salary | Depar原创 2016-02-19 18:02:22 · 375 阅读 · 0 评论 -
Database LeetCode Second Highest Salary
题目:Write a SQL query to get the second highest salary from theEmployee table.+----+--------+| Id | Salary |+----+--------+| 1 | 100 || 2 | 200 || 3 | 300 |+----+--------+原创 2016-02-19 12:58:53 · 354 阅读 · 0 评论 -
Database Leetcode Customers Who Never Order
题目:Suppose that a website contains two tables, the Customers table and theOrders table. Write a SQL query to find all customers who never order anything.Table: Customers.+----+-------+| Id原创 2016-02-18 17:07:19 · 391 阅读 · 0 评论 -
Database Leetcode Combine Two Tables
题目:Table: Person+-------------+---------+| Column Name | Type |+-------------+---------+| PersonId | int || FirstName | varchar || LastName | varchar |+-------------+---------原创 2016-02-18 16:17:15 · 379 阅读 · 0 评论 -
Database LeetCode Employees Earning More Than Their Managers
题目:The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id.+----+-------+--------+-----------+| Id | Name | Salar原创 2016-02-17 20:33:26 · 394 阅读 · 0 评论 -
python连接mysql数据库实例
利用python去连接mysql数据库,通引入mysqldb这个第三方库去连接即可。可以写一个DB class,里面涵盖要连接的主机、用户名、密码、数据库name、端口号等信息。import MySQLdbimport sysreload(sys)sys.setdefaultencoding('utf8')import MySQLdb.cursorsclass DB(objec...原创 2019-03-05 10:04:07 · 1478 阅读 · 0 评论