In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
< /tmp/databasename.bak.yyyymmdd.sql导出某个表:pg_dump -h localhost -U postgres -t tablename dbname >Test.sql exports the structure of a table, adding the parameter "- s": pg_dump-h localhost-U postgres-t tablename-s dbname > test_construct.sql to export the data of a table, and adding the parameter "- a": pg_dump-h localhost-U postgres-t tablename-a dbname > test_data.sql View sequence: select * from information_schema.sequences where sequence_schema = 'public'
5. Submit the code on windows to GitLab through Git tool
Description: many developers like to use Git tools to submit code to GitLab, so let's focus on this.
1. First download Git and install it
Download address: after the https://git-for-windows.github.io is downloaded, double-click Git-2.13.0-64-bit.exe to install.
Note: Next all the way, according to the default choice! (here's what I did. If you have your own special needs, you can customize it.)
2. Open Git and configure it, as shown below:
Double-clicking "Git Bash" will bring up a shell box, as follows:
All right, Git Bash is open, so let's register a normal user on GitLab and submit the code.
3. Register a user on GitLab, as shown below:
After the registration is successful, you will see a page that prompts you to register successfully, prompting: Welcome! You have signed up successfully.
Because it is an internal test virtual machine, the network is slow, so after registering an ordinary account, there is some delay in sending mail and sending it to the junk mailbox, as shown below:
You can see that the content of the email prompts you to add pub key, just follow the steps below!
4. Create a project
After registering, click the "+" icon in the upper right corner (create a new project icon) to start creating a new project, as shown below:
After clicking "Create project", a page will be reopened as follows:
You can learn from the prompt that the project created by the new user needs to add SSH key! Clicking "add an SSH key" will bring up a new page that prompts you to paste the generated pub key into it, as shown below:
OK, at this point we will turn our attention to the Git tool of the windows machine, generate the public key through this tool, and then add it.
5. Generate the public key using Git and add it to GitLab
Generate the public key command: ssh-keygen-t rsa-C "mailbox" and then enter all the way!
According to the above figure, the generated public key is under the C:\ Users\ Administrator.2345-20170207QA\ .ssh directory, then open id_rsa.pub and copy the string to the GitLab page intact, as shown below:
Clicking "Add key" will bring up a page indicating that key has been added successfully, and Title will automatically complete the email address entered when generating key!
6. Then test the mytest project that uploads the code to GitLab
In fact, some commands for uploading codes are given to us on the new project page of the GitLab interface. We can follow the steps above, as follows:
Git global setup global setting $git config-- global user.name "new_user_name" # user name at registration $git config-- global user.email "email address when generating pub key" Create a new repository create a new library $git clone git@gitlab.example.com:new_user_name/mytest.git$cd mytest$touch README.md$git add README.md$git commit-m "add README" $git push-u origin master because it is a new project, there are no other files So just execute the above 8 commands! # cd existing_foldergit initgit remote add origin git@gitlab.example.com:new_user_name/mytest.gitgit add .git commitgit push-u origin masterExisting Git repository where Existing folder already exists An existing library cd existing_repogit remote add origin git@gitlab.example.com:new_user_name/mytest.gitgit push-u origin-- allgit push-u origin-- tags
Execute the 8 commands listed above in the Git Bash tool, as shown below:
Note: when executing the third command, an error was reported, indicating that the gitlab.example.com could not be parsed because it was an internal test machine, so I did not do any parsing, so I reported an error. Then I will parse it in the hosts file of the local windows machine, and then execute it again on ok!
192.168.159.129 gitlab.example.com
The purpose of executing the third command is to pull the project mytest created above gitlab locally. Let's see if the pull is successful, as shown below:
You can see that mytest/ has been successfully pulled to the windows machine!
Continue to execute the command, create a README.md file under the mytest/ project, and upload it to gitlab, as shown below:
After the upload is successful, we go to the mytest project on gitlab to view the uploaded file, as shown below:
You can see that the README.md file has been successfully uploaded to the mytest/ project!
#
The above description is to upload local code to gitlab. For developers, the project name and code are in English and are easy to maintain. However, for system engineers, it may be necessary to upload some documents to gitlab for reference by other technicians, so let me introduce how to upload Chinese directories and files to gitlab: first, create a Chinese directory under the project directory of the local windows machine (here take the mytest project as an example), as shown below:
Then create a "test 1.txt" file under the "test Chinese directory" and upload it to git through the Git Bash tool, as shown in the following figure
Execute the 2, 3, 4 commands of Standard Red! Then go to gitlab to see if the Chinese language can be displayed properly, as shown below:
You can see that Chinese displays normally on gitlab. Just now I just created the "Test 1.txt" file in the "Test Chinese Catalog" and did not write Chinese in it. Now I write a Chinese test with the content "this is to test whether gitlab can display Chinese properly!" Then push to gitlab, as shown below:
After the execution is completed, check it on gitlab, as shown below:
It is normal that you can see it!
Note: you cannot directly create a project name in Chinese or with a Chinese name on gitlab. The prompt for reporting an error is as follows:
Path can contain only letters, digits,'_','- 'and'. Cannot start with'-', end in '.git' or end in '.atom'
You can create an English project name, create a Chinese directory under this project, and save the Chinese document. However, it is said that tools can be used to achieve the purpose of creating Chinese project names, so this will not be introduced.
6. Gitlab forgot how to get his password back
Note: some friends' passwords are easy to remember or forget, so if you forget your password, how to get it back?
First of all, you click on the Forgot your password connection in the gitlab login screen, as follows:
Then a page pops up, as follows:
Enter the email address left by the registered user, which shows the importance of the email address, and then click "Reset password". On the pop-up page, you will be prompted to send an email with the password reset to your email, and then you can check it in your email, as shown below:
You can see the email in the trash can. Checking the email and clicking "Reset password" will bring up the reset password page, and you can re-enter your new password. Then pop up the re-login interface, enter the user name and the newly set password, and you can log in smoothly! Finally, an email will be sent to inform you that the password has been successfully changed, as shown in the following figure:
Inadequacies, please leave a lot of comments!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.