php_network_getaddresses: getaddrinfo failed: Name or service not known

Getting the below error?

Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known    

Fixing it is simple you just need to know the syntax.

At the prompt type:

# sudo -u www-data php occ db:convert-type –all-apps –clear-schema –no-interaction –password=”password_here” mysql database_user_account_name 127.0.0.1:3306 nextcloud_database_name

 

You should see status like below:

Creating schema in new database
oc_accounts
 13/13 [============================] 100%oc_activity
chunked query, 2 chunks
 1780/1780 [============================] 100%oc_activity_mq
 21/21 [============================] 100%oc_addressbookchanges
 87/87 [============================] 100%oc_addressbooks
 5/5 [============================] 100%oc_appconfig
 211/211 [============================] 100%oc_authtoken
 11/11 [============================] 100%oc_bruteforce_attempts
    0 [>—————————]oc_calendar_invitations
    0 [>—————————]oc_calendar_reminders
    0 [>—————————]oc_calendar_resources
    0 [>—————————]oc_calendar_resources_md
    0 [>—————————]oc_calendar_rooms
    0 [>—————————]oc_calendar_rooms_md
    0 [>—————————]oc_calendarchanges
    0 [>—————————]oc_calendarobjects
    0 [>—————————]oc_calendarobjects_props
    0 [>—————————]oc_calendars
 5/5 [============================] 100%oc_calendarsubscriptions
    0 [>—————————]oc_cards
 13/13 [============================] 100%oc_cards_properties
 65/65 [============================] 100%oc_collres_accesscache
    0 [>—————————]oc_collres_collections
    0 [>—————————]oc_collres_resources
    0 [>—————————]oc_comments
 16/16 [============================] 100%oc_comments_read_markers
    0 [>—————————]oc_credentials
 4/4 [============================] 100%oc_dav_cal_proxy
    0 [>—————————]oc_dav_shares
    0 [>—————————]oc_direct_edit
    0 [>—————————]oc_directlink
    0 [>—————————]oc_e2e_encryption_lock
    0 [>—————————]oc_external_applicable
    0 [>—————————]oc_external_config
    0 [>—————————]oc_external_mounts
    0 [>—————————]oc_external_options
    0 [>—————————]oc_federated_reshares
    0 [>—————————]oc_file_locks
 4/4 [============================] 100%oc_filecache
chunked query, 3 chunks
 2182/2182 [============================] 100%oc_filecache_extended
 20/20 [============================] 100%oc_files_antivirus
    0 [>—————————]oc_files_avir_status
 19/19 [============================] 100%oc_files_trash
 20/20 [============================] 100%oc_flow_checks
    0 [>—————————]oc_flow_operations
    0 [>—————————]oc_flow_operations_scope
    0 [>—————————]oc_group_admin
 2/2 [============================] 100%oc_group_user
 13/13 [============================] 100%oc_groups
 3/3 [============================] 100%oc_jobs
 63/63 [============================] 100%oc_login_flow_v2
    0 [>—————————]oc_mail_accounts
    0 [>—————————]oc_mail_aliases
    0 [>—————————]oc_mail_attachments
    0 [>—————————]oc_mail_coll_addresses
    0 [>—————————]oc_mail_mailboxes
    0 [>—————————]oc_migrations
Skipping migrations table because it was already filled by running the migrations
oc_mimetypes
 21/21 [============================] 100%oc_mounts
 9/9 [============================] 100%oc_notifications
 10/10 [============================] 100%oc_notifications_pushtokens
    0 [>—————————]oc_oauth2_access_tokens
    0 [>—————————]oc_oauth2_clients
    0 [>—————————]oc_passwords_entity_challenge
    0 [>—————————]oc_passwords_entity_folder
    0 [>—————————]oc_passwords_entity_folder_revision
    0 [>—————————]oc_passwords_entity_keychain
    0 [>—————————]oc_passwords_entity_password
    0 [>—————————]oc_passwords_entity_password_revision
    0 [>—————————]oc_passwords_entity_session
    0 [>—————————]oc_passwords_entity_share
    0 [>—————————]oc_passwords_entity_tag
    0 [>—————————]oc_passwords_entity_tag_revision
    0 [>—————————]oc_passwords_relation_password_tag
    0 [>—————————]oc_preferences
 114/114 [============================] 100%oc_privacy_admins
    0 [>—————————]oc_properties
    0 [>—————————]oc_registration
    0 [>—————————]oc_schedulingobjects
    0 [>—————————]oc_share
 5/5 [============================] 100%oc_share_external
    0 [>—————————]oc_storages
 14/14 [============================] 100%oc_systemtag
    0 [>—————————]oc_systemtag_group
    0 [>—————————]oc_systemtag_object_mapping
    0 [>—————————]oc_talk_commands
 1/1 [============================] 100%oc_talk_guests
    0 [>—————————]oc_talk_participants
 1/1 [============================] 100%oc_talk_rooms
 1/1 [============================] 100%oc_talk_signaling
    0 [>—————————]oc_termsofservice_sigs
    0 [>—————————]oc_termsofservice_terms
    0 [>—————————]oc_text_documents
 1/1 [============================] 100%oc_text_sessions
 1/1 [============================] 100%oc_text_steps
    0 [>—————————]oc_trusted_servers
    0 [>—————————]oc_twofactor_backupcodes
    0 [>—————————]oc_twofactor_providers
 8/8 [============================] 100%oc_user_transfer_owner
    0 [>—————————]oc_users
 13/13 [============================] 100%oc_vcategory
    0 [>—————————]oc_vcategory_to_object
    0 [>—————————]oc_whats_new

 

If you’re still having issues please respond to this thread.


Go to Source of this post
Author Of this post:
Title Of post: php_network_getaddresses: getaddrinfo failed: Name or service not known
Author Link: {authorlink}