[Translation] build migration -up,down,change method -Phinx tutorial (2)

[Translation] build migration -up,down,change method -Phinx tutorial (2)

Technical application 3 years ago (2015-08-26) Views: 0 Comments: 0

This article has been translated by the ultimate guest since: http://phinx.readthedocs.org, bad place, please correct me; series of articles please visit Wang Baiyuan's blog Phinx tab or use geek search: Phinx Get all article directories To convert databases: To restore or modify data, Phinx is implemented through a series of Migrations files.Each Migrations file is actually a PHP class. The best way to trap a migration is through the API provided by Phinx. Of course, running native SQL statements is also possible. New Phinx Migration Create a new Phinx Migration migration.We want to run Phinx's create command in the project folder:After running the above command, the migration file (this folder is the migrations folder in which you installed phinx) will generate a PHP file named YYYYMMDDHHMMSS_my_new_migration.php with the time stamp of the current 14 characters in the first 14 characters.Phinx automatically creates a framework migration file with two empty and a commented out methods: AbstractMigration class All Phinx Migration migration classes inherit from the AbstractMigration class, which provides the necessary support to create database migrations.Database migration can create new tables, insert rows, add indexes, and modify columns. Up() method When you migrate up the database (that is, make new changes

Java implementation webservice+MySQl

Java implementation webservice+MySQl

About webservice Due to the JSON and JMI web services written in JAVA and PHP, this time it is natural to think about using webservice to manage the to-do list.What JAVA and PHP JSON, JMI, and webservice have in common is that they can provide server resource sharing. Web Service is cross-platform and can be invoked in different devices and different programming languages, so its application scope should be wider than RMI. Webservice implementation management to-do list based on MySQl database query Run the screenshot Add User: Add Items: Inquiry Items: Delete Items: Clear Items: How server-side code is implemented Here's how to implement the server-side code for the above functions:. My server has four main categories: database connection and method interface TodoListInterDbFace, database connection and method implementation class TodolistDb and method implementation class and webservice interface TodoListServerInterface, Webservice implementation class TodoListServer.   The following is a schematic diagram: How the client code is implemented Wsimport -keep http://127.0.0.1:8002/webservice/TodoList?wsdl After parsing the WSDL: The main method for creating the TodoListClient class is:   For the realization of the menu please refer to my blog article: http://wangbaiyuan.cn/java-rmi-6-making-the-command-line-navigation-menu.html

SSD8_Ex3 [JAVA_RMI] (5) database connection and meeting method definition

SSD8_Ex3 [JAVA_RMI] (5) database connection and meeting method definition

Algorithm language computer technology 3 years ago (2015-06-12) Views: 1 Comments: 0

The following code is the key to the use of the database to achieve RMI meeting management in this experiment. The main method is to implement database connection and implement related query methods. These methods have been stated in the previous article's interface code, but there is no substance.The RmiDataBase class inherits the meetinginterface interface. Series links: SSD8_Ex3 [JAVA_RMI Service] (1) Overview of RMI and Network APIs SSD8_Ex3[JAVA_RMI](2) Remote Interface Declaration SSD8_Ex3 [JAVA_RMI] (3) Open RMI Service SSD8_Ex3 [JAVA_RMI] (4) conference database table SSD8_Ex3 [JAVA_RMI] (5) database connection and meeting method definition SSD8_Ex3 [JAVA_RMI] (6) Create Command Line Navigation Menu RmiDataBase.java     Custom exception handling class: BYException.java      

SSD8_Ex3 [JAVA_RMI] (4) conference database table

SSD8_Ex3 [JAVA_RMI] (4) conference database table

Algorithm language Technical application 3 years ago (2015-06-11) Views: 7 Comments: 0

In order to better manage meetings and perform deletion, addition, and query operations more efficiently, this SSD8_Ex3 [JAVA_RMI], the Extreme Guest combined with database system knowledge, decided to use the database to manage the meeting.Because each topic of this exercise is a typical database problem, although it is placed on the network and distributed computing courses. Series links: SSD8_Ex3 [JAVA_RMI Service] (1) Overview of RMI and Network APIs SSD8_Ex3[JAVA_RMI](2) Remote Interface Declaration SSD8_Ex3 [JAVA_RMI] (3) Open RMI Service SSD8_Ex3 [JAVA_RMI] (4) conference database table SSD8_Ex3 [JAVA_RMI] (5) database connection and meeting method definition SSD8_Ex3 [JAVA_RMI] (6) Create Command Line Navigation Menu   Conference database rmimeeting build table Database name: rmimeeting Create three items: users, meeting, meetingrecord rmimeetingER diagram Table statement  

Using Navicat to Make ER Diagram and Interconvert with SQL

Using Navicat to Make ER Diagram and Interconvert with SQL

Technical application 3 years ago (2015-05-21) Views: 131 Comments: 0

Navicat guests used personal data in the database learning process to think of the best database connectivity, design, and editing software.It is not only the most beautiful interface in the database software used by the very guests, but also the most powerful and simple to operate. Navicat has for MySQL, for MariaDB, for SQL Server, for SQLite, and for Oracle. For multiple single database versions such as PostgreSQL, and also a comprehensive version of Navicat Premium, Navicat Premium is a multi-connected database management tool that allows you to connect to MySQL, MariaDB, SQL Server, SQLite, Oracle and The PostgreSQL database supports most of the functions used in today's database management systems, including stored procedures, events, triggers, functions, views, etc. At the same time, users can be added to the database to set permissions. Extreme users use Navicat in addition to the above common features, but also use navicat for database data backup, synchronization, Wang Baiyuan's blog on the virtual machine database data backup, synchronized to the local, or use navicat to move the site.I mainly introduce how to use Navicat to make ER diagrams and interconvert with SQL: export database tables into ER diagrams and export ER diagrams into SQL

SSD7_EX2 [SQL]

SSD7_EX2 [SQL]

Algorithm language 4 years ago (2015-04-30) Views: 0 Comments: 0

This is the EX2 of the SSD7 practice. It is expected that the extreme guests will write a series. The update frequency will be synchronized with the 2013 level progress of the NWPU database system experiment class.Click the tab or search "SSD7" on this site to get the updated SSD7 answer.Previous Exercise: SSD7_EX1 [Relational Database] Run a given SQL script to create a library database.Note that each row in the Book table refers to a copy of a book. Therefore, if a database has three "DBMSs", then the Book table will have three rows, one for each row. Write SQL statements to accomplish the following operations.(Note: For each operation, you must use a SQL statement to express your query. However, a statement can contain subqueries.) Original: Run the SQL script given to you to create a Library database. Note that each row in the Book table markeds a book copy. Thus, if the Library carries three copies of the title "DBMS", there will be three rows in the Book table, one for each copy. Write the SQL statements to do the following against the database (Note: You must express your query in a single SQL statement for each of the

MySql database to create, delete and display version

MySql database to create, delete and display version

Software development 4 years ago (2015-04-08) Views: 8 Comments: 0

4.1 Creating a Database Note: Connect to the Mysql server command before creating the database: create database <database name> Example 1: Create a Database named xhkdb    Mysql> create database xhkdb; Example 2: Creating a Database and Assigning Users 1CREATE DATABASE database name; 2GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER ON database name. * TO database name @ localhost IDENTIFIED BY 'password'; 3SET PASSWORD FOR 'database name' @ 'localhost' = OLD_PASSWORD (' Password '); execute three commands in order to complete database creation.Note: The Chinese "password" and "database" are set by the user himself. 4.2 Display Database Command: show databases (Note: the last s) mysql> show databases; Note: In order to no longer display garbled, you must modify the database default encoding.The following uses the GBK encoding page as an example to illustrate: 1, modify the MYSQL configuration file: Modify the default-character-set=gbk in my.ini 2, code runtime modification:    1Java code: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=gbk 2PHP code: header("Content-Type:text/html;charset=gb2312"); 3C language code: int mysql_set_character_set( MYSQL * mysql , char * csname); This function is used to set the default character set for the current connection.The string csname specifies a valid character set name.Connection proofing becomes the default proofreader for character sets.This function works

mySQL database connection, change password, create a new user operation command

mySQL database connection, change password, create a new user operation command

Software development 4 years ago (2015-04-08) Views: 3 Comments: 0

1, connect to Mysql Format: mysql -h host address -u username -p user password Connect to MYSQL on this machine. First open the DOS window, and then enter the directory mysql bin, and then type the command mysql -u root -p, after the carriage return prompts you to enter the password. Note that the user name can have spaces or no spaces, but the password must be no space, otherwise let You re-enter your password.If you just installed MYSQL, the superuser root has no password, so you can enter MYSQL directly by pressing Enter. The MYSQL prompt is: mysql>2, connect to MYSQL on the remote host.Assume that the remote host's IP address is 110.110.110.110, the user name is root, and the password is abcd123.Then type the following command: mysql -h110.110.110.110 -u root -p 123; (Note: u and root can be without spaces, the other is the same) 3, exit MYSQL command: exit (Enter) 2, change the password Format: mysqladmin -u username -p old password password new password 1. Add a password ab12 to the root. First, enter the directory mysqlbin under DOS, and then type the following command: mysqladmin -u root -password ab12 Note: Since the root has no password

登录

Forget password?

您也可以使用第三方帐号快捷登录

切换登录

注册

TW